aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmimaso <git@umimaso.com>2021-06-19 23:56:32 +0100
committerJesús <heckyel@hyperbola.info>2021-06-23 12:42:17 -0500
commit5b4c99c702757aa33393155af638b468983bbeb4 (patch)
treeaff3744d087f45c7f166c766d59b74174df51204
parent95ae35260c7d141341d6e81d8233568f98e9acdb (diff)
downloadyt-local-5b4c99c702757aa33393155af638b468983bbeb4.tar.lz
yt-local-5b4c99c702757aa33393155af638b468983bbeb4.tar.xz
yt-local-5b4c99c702757aa33393155af638b468983bbeb4.zip
feat: add direct link
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rw-r--r--youtube/static/watch.css6
-rw-r--r--youtube/templates/watch.html2
-rw-r--r--youtube/watch.py1
3 files changed, 9 insertions, 0 deletions
diff --git a/youtube/static/watch.css b/youtube/static/watch.css
index 73eefdc..90c08d5 100644
--- a/youtube/static/watch.css
+++ b/youtube/static/watch.css
@@ -257,6 +257,7 @@ label[for=options-toggle-cbox] {
"v-uploaded v-views"
"v-published v-likes-dislikes"
"external-player-controls v-checkbox"
+ "v-direct-link v-direct-link"
"v-download v-download"
"v-description v-description"
"v-music-list v-music-list"
@@ -287,6 +288,11 @@ label[for=options-toggle-cbox] {
grid-area: v-checkbox;
justify-self: end;
}
+.v-direct-link {
+ grid-area: v-direct-link;
+ padding-top: 0.5rem;
+ padding-bottom: 0.5rem;
+}
.v-download { grid-area: v-download; }
.v-download > ul.download-dropdown-content {
background: var(--secondary-background);
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html
index a8442ca..7068fb7 100644
--- a/youtube/templates/watch.html
+++ b/youtube/templates/watch.html
@@ -86,6 +86,8 @@
<input class="v-checkbox" name="video_info_list" value="{{ video_info }}" form="playlist-edit" type="checkbox">
+ <span class="v-direct-link"><a href="https://youtu.be/{{ video_id }}" >Direct Link</a></span>
+
<details class="v-download">
<summary class="download-dropdown-label">Download</summary>
<ul class="download-dropdown-content">
diff --git a/youtube/watch.py b/youtube/watch.py
index 14d5fcd..6ff0735 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -546,6 +546,7 @@ def get_watch_page(video_id=None):
invidious_used = info['invidious_used'],
invidious_reload_button = info['invidious_reload_button'],
video_url = util.URL_ORIGIN + '/watch?v=' + video_id,
+ video_id = video_id,
time_start = time_start,
js_data = {