Shuffle invidious instances
This commit is contained in:
parent
21e9cb2a0c
commit
46d841fa85
|
@ -125,7 +125,9 @@ async def handle_video(video_id, video_title):
|
||||||
tmp_handled_videos.discard(video_id)
|
tmp_handled_videos.discard(video_id)
|
||||||
|
|
||||||
async def get_video_list(session, channel_id):
|
async def get_video_list(session, channel_id):
|
||||||
for i in invidious_instances:
|
shuffled_instances = invidious_instances.copy()
|
||||||
|
random.shuffle(shuffled_instances)
|
||||||
|
for i in shuffled_instances:
|
||||||
try:
|
try:
|
||||||
async with session.get(f'{i}/api/v1/channels/{channel_id}/latest?fields=title,videoId&a={time.time()}', headers={'Cache-Control': 'no-store, max-age=0'}) as resp:
|
async with session.get(f'{i}/api/v1/channels/{channel_id}/latest?fields=title,videoId&a={time.time()}', headers={'Cache-Control': 'no-store, max-age=0'}) as resp:
|
||||||
if resp.status != 200:
|
if resp.status != 200:
|
||||||
|
|
Loading…
Reference in New Issue