aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-07-09 03:42:26 -0700
committerJames Taylor <user234683@users.noreply.github.com>2018-07-09 03:42:26 -0700
commit4b716415e1a0cda01fc36693986bf59f075fb344 (patch)
tree1843d0aa8b7e7df0c5c6257311d2de74cc6837c6 /youtube
parentcdb7dbab557f866b7c9d0d831f2581cbe26b4a3e (diff)
downloadyt-local-4b716415e1a0cda01fc36693986bf59f075fb344.tar.lz
yt-local-4b716415e1a0cda01fc36693986bf59f075fb344.tar.xz
yt-local-4b716415e1a0cda01fc36693986bf59f075fb344.zip
add checkbox for adding video on watch page to playlist
Diffstat (limited to 'youtube')
-rw-r--r--youtube/shared.css8
-rw-r--r--youtube/watch.py37
2 files changed, 28 insertions, 17 deletions
diff --git a/youtube/shared.css b/youtube/shared.css
index 8db482e..e590821 100644
--- a/youtube/shared.css
+++ b/youtube/shared.css
@@ -159,6 +159,12 @@ address{
grid-row: 4;
justify-self:end;
}
+ .full-item .checkbox{
+ justify-self:end;
+
+ grid-row: 5;
+ grid-column: 2;
+ }
.full-item .description{
background-color:#d0d0d0;
margin-top:8px;
@@ -166,7 +172,7 @@ address{
min-width: 0;
grid-column: 1 / span 2;
- grid-row: 5;
+ grid-row: 6;
}
.medium-item-box{
diff --git a/youtube/watch.py b/youtube/watch.py
index 895f9bf..7c11380 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -266,7 +266,12 @@ def get_watch_page(query_string):
#chosen_format = choose_format(info)
sort_formats(info)
-
+ video_info = {
+ "duration": common.seconds_to_timestamp(info["duration"]),
+ "id": info['id'],
+ "title": info['title'],
+ "author": info['uploader'],
+ }
upload_year = info["upload_date"][0:4]
upload_month = info["upload_date"][4:6]
@@ -276,20 +281,20 @@ def get_watch_page(query_string):
related_videos_html = get_related_items_html(info)
page = yt_watch_template.substitute(
- video_title=html.escape(info["title"]),
- page_title=html.escape(info["title"]),
- header=common.get_header(),
- uploader=html.escape(info["uploader"]),
- uploader_channel_url='/' + info["uploader_url"],
- #upload_date=datetime.datetime.fromtimestamp(info["timestamp"]).strftime("%d %b %Y %H:%M:%S"),
- upload_date = upload_date,
- views='{:,}'.format(info["view_count"]),
- likes=(lambda x: '{:,}'.format(x) if x is not None else "")(info["like_count"]),
- dislikes=(lambda x: '{:,}'.format(x) if x is not None else "")(info["dislike_count"]),
- description=html.escape(info["description"]),
- video_sources=formats_html(info),
- related = related_videos_html,
- comments=comments_html,
- more_comments_button = more_comments_button,
+ video_title = html.escape(info["title"]),
+ page_title = html.escape(info["title"]),
+ header = common.get_header(),
+ uploader = html.escape(info["uploader"]),
+ uploader_channel_url = '/' + info["uploader_url"],
+ upload_date = upload_date,
+ views = '{:,}'.format(info["view_count"]),
+ likes = (lambda x: '{:,}'.format(x) if x is not None else "")(info["like_count"]),
+ dislikes = (lambda x: '{:,}'.format(x) if x is not None else "")(info["dislike_count"]),
+ video_info = html.escape(json.dumps(video_info)),
+ description = html.escape(info["description"]),
+ video_sources = formats_html(info),
+ related = related_videos_html,
+ comments = comments_html,
+ more_comments_button = more_comments_button,
)
return page \ No newline at end of file