6 Commits
0.2.4 ... 0.2.5

Author SHA1 Message Date
Jesus E
6740afd6a0 version 0.2.5 2023-06-18 20:30:39 -04:00
Jesus E
63c0f4aa8f Fix typo 2023-06-18 20:12:48 -04:00
Jesus E
8908dc138f Set related videos thumbnail to HQ 2023-06-18 19:47:15 -04:00
Jesus E
cd7624f2cb Set hqdefault thumnail images 2023-06-18 19:45:34 -04:00
Jesus E
5d53225874 Fix pagination 2023-06-18 13:55:07 -04:00
Jesus E
6af17450c6 README.md: update 2023-06-17 20:01:01 -04:00
9 changed files with 11 additions and 10 deletions

View File

@@ -153,7 +153,7 @@ For coding guidelines and an overview of the software architecture, see the [HAC
yt-local is not made to work in public mode, however there is an instance of yt-local in public mode but with less features
- <https://fast-gorge-89206.herokuapp.com>
- <https://06ff-93-95-230-133.ngrok-free.app/https://www.youtube.com/>
## License

View File

@@ -36,7 +36,7 @@ generic_cookie = (('Cookie', 'VISITOR_INFO1_LIVE=ST1Ti53r4fU'),)
# changed offset field to uint id 1
def channel_ctoken_v5(channel_id, page, sort, tab, view=1):
new_sort = (2 if int(sort) == 1 else 1)
offset = str(30*(int(page) - 1))
offset = 30*(int(page) - 1)
if tab == 'videos':
tab = 15
elif tab == 'shorts':
@@ -85,7 +85,7 @@ def channel_ctoken_v5(channel_id, page, sort, tab, view=1):
# https://github.com/user234683/youtube-local/issues/151
def channel_ctoken_v4(channel_id, page, sort, tab, view=1):
new_sort = (2 if int(sort) == 1 else 1)
offset = 30*(int(page) - 1)
offset = str(30*(int(page) - 1))
pointless_nest = proto.string(80226972,
proto.string(2, channel_id)
+ proto.string(3,

View File

@@ -150,7 +150,7 @@ def post_process_comments_info(comments_info):
util.URL_ORIGIN, '/watch?v=', comments_info['video_id'])
comments_info['video_thumbnail'] = concat_or_none(
settings.img_prefix, 'https://i.ytimg.com/vi/',
comments_info['video_id'], '/mqdefault.jpg'
comments_info['video_id'], '/hqdefault.jpg'
)

View File

@@ -104,7 +104,7 @@ def get_playlist_page():
util.prefix_urls(item)
util.add_extra_html_info(item)
if 'id' in item:
item['thumbnail'] = settings.img_prefix + 'https://i.ytimg.com/vi/' + item['id'] + '/default.jpg'
item['thumbnail'] = f"{settings.img_prefix}https://i.ytimg.com/vi/{item['id']}/hqdefault.jpg"
item['url'] += '&list=' + playlist_id
if item['index']:

View File

@@ -1018,7 +1018,7 @@ def serve_subscription_thumbnail(thumbnail):
f.close()
return flask.Response(image, mimetype='image/jpeg')
url = "https://i.ytimg.com/vi/" + video_id + "/mqdefault.jpg"
url = f"https://i.ytimg.com/vi/{video_id}/hqdefault.jpg"
try:
image = util.fetch_url(url, report_text="Saved thumbnail: " + video_id)
except urllib.error.HTTPError as e:

View File

@@ -462,7 +462,7 @@ class RateLimitedQueue(gevent.queue.Queue):
def download_thumbnail(save_directory, video_id):
url = "https://i.ytimg.com/vi/" + video_id + "/mqdefault.jpg"
url = f"https://i.ytimg.com/vi/{video_id}/hqdefault.jpg"
save_location = os.path.join(save_directory, video_id + ".jpg")
try:
thumbnail = fetch_url(url, report_text="Saved thumbnail: " + video_id)
@@ -504,7 +504,7 @@ def video_id(url):
# default, sddefault, mqdefault, hqdefault, hq720
def get_thumbnail_url(video_id):
return settings.img_prefix + "https://i.ytimg.com/vi/" + video_id + "/mqdefault.jpg"
return f"{settings.img_prefix}https://i.ytimg.com/vi/{video_id}/hqdefault.jpg"
def seconds_to_timestamp(seconds):

View File

@@ -1,3 +1,3 @@
from __future__ import unicode_literals
__version__ = '0.2.4'
__version__ = '0.2.5'

View File

@@ -686,6 +686,7 @@ def get_watch_page(video_id=None):
# prefix urls, and other post-processing not handled by yt_data_extract
for item in info['related_videos']:
item['thumbnail'] = "https://i.ytimg.com/vi/{}/hqdefault.jpg".format(item['id']) # set HQ relateds thumbnail videos
util.prefix_urls(item)
util.add_extra_html_info(item)
for song in info['music_list']:

View File

@@ -168,7 +168,7 @@ def extract_playlist_metadata(polymer_json):
if metadata['first_video_id'] is None:
metadata['thumbnail'] = None
else:
metadata['thumbnail'] = 'https://i.ytimg.com/vi/' + metadata['first_video_id'] + '/mqdefault.jpg'
metadata['thumbnail'] = f"https://i.ytimg.com/vi/{metadata['first_video_id']}/hqdefault.jpg"
metadata['video_count'] = extract_int(header.get('numVideosText'))
metadata['description'] = extract_str(header.get('descriptionText'), default='')