aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-12-26 13:29:55 -0500
committerJesús <heckyel@hyperbola.info>2021-12-26 13:29:55 -0500
commit92067638b10f8debbbfa4ffd4a3cd990a2c2149e (patch)
tree801bdac14a75040914f61c7770ff0cdd28063b67
parent99b70497f25cff562d60744b134b6ab4b10055ad (diff)
downloadyt-local-92067638b10f8debbbfa4ffd4a3cd990a2c2149e.tar.lz
yt-local-92067638b10f8debbbfa4ffd4a3cd990a2c2149e.tar.xz
yt-local-92067638b10f8debbbfa4ffd4a3cd990a2c2149e.zip
Disable dislikes
Ref: https://blog.youtube/news-and-events/update-to-youtube/
-rw-r--r--youtube/templates/watch.html2
-rw-r--r--youtube/watch.py1
-rw-r--r--youtube/yt_data_extract/watch_extraction.py5
3 files changed, 1 insertions, 7 deletions
diff --git a/youtube/templates/watch.html b/youtube/templates/watch.html
index 84585a2..7c8f5cf 100644
--- a/youtube/templates/watch.html
+++ b/youtube/templates/watch.html
@@ -78,7 +78,7 @@
<address class="v-uploaded">Uploaded by <a href="{{ uploader_channel_url }}">{{ uploader }}</a></address>
<span class="v-views">{{ view_count }} views</span>
<time class="v-published" datetime="{{ time_published_utc }}">Published on {{ time_published }}</time>
- <span class="v-likes-dislikes">{{ like_count }} likes {{ dislike_count }} dislikes</span>
+ <span class="v-likes-dislikes">{{ like_count }} likes</span>
<div class="external-player-controls">
<input class="speed" id="speed-control" type="text" title="Video speed">
diff --git a/youtube/watch.py b/youtube/watch.py
index c9a5f77..85b4bd9 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -694,7 +694,6 @@ def get_watch_page(video_id=None):
time_published_utc=time_utc_isoformat(info['time_published']),
view_count = (lambda x: '{:,}'.format(x) if x is not None else "")(info.get("view_count", None)),
like_count = (lambda x: '{:,}'.format(x) if x is not None else "")(info.get("like_count", None)),
- dislike_count = (lambda x: '{:,}'.format(x) if x is not None else "")(info.get("dislike_count", None)),
download_formats = download_formats,
other_downloads = other_downloads,
video_info = json.dumps(video_info),
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py
index c73033c..59c5a51 100644
--- a/youtube/yt_data_extract/watch_extraction.py
+++ b/youtube/yt_data_extract/watch_extraction.py
@@ -135,7 +135,6 @@ def _extract_from_video_information_renderer(renderer_content):
def _extract_likes_dislikes(renderer_content):
info = {
'like_count': None,
- 'dislike_count': None,
}
for button in renderer_content.get('buttons', ()):
button_renderer = button.get('slimMetadataToggleButtonRenderer', {})
@@ -157,8 +156,6 @@ def _extract_likes_dislikes(renderer_content):
if 'isLike' in button_renderer:
info['like_count'] = count
- elif 'isDislike' in button_renderer:
- info['dislike_count'] = count
return info
def _extract_from_owner_renderer(renderer_content):
@@ -353,10 +350,8 @@ def _extract_watch_info_desktop(top_level):
likes_dislikes = deep_get(video_info, 'sentimentBar', 'sentimentBarRenderer', 'tooltip', default='').split('/')
if len(likes_dislikes) == 2:
info['like_count'] = extract_int(likes_dislikes[0])
- info['dislike_count'] = extract_int(likes_dislikes[1])
else:
info['like_count'] = None
- info['dislike_count'] = None
info['title'] = extract_str(video_info.get('title', None))
info['author'] = extract_str(deep_get(video_info, 'owner', 'videoOwnerRenderer', 'title'))