Skip to content

Commit 217bb5a

Browse files
committed
watch: append po_token to video url
Append po_token to video urls.
1 parent a74d796 commit 217bb5a

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

youtube/watch.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ def decrypt_n_signatures(info, video_id):
359359
err = yt_data_extract.replace_n_signatures(info)
360360
return err
361361

362+
def append_po_token(info):
363+
err = yt_data_extract.append_po_token(info)
364+
return err
365+
362366
def _add_to_error(info, key, additional_message):
363367
if key in info and info[key]:
364368
info[key] += additional_message
@@ -462,7 +466,11 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None):
462466
if nsig_decryption_error:
463467
decryption_error += 'Error decrypting n signatures: ' + nsig_decryption_error
464468
info['playability_error'] = decryption_error
465-
469+
# append po_token
470+
po_token_append_error = append_po_token(info)
471+
if po_token_append_error:
472+
decryption_error += 'Error appending po_token'
473+
info['playability_error'] = decryption_error
466474
# check if urls ready (non-live format) in former livestream
467475
# urls not ready if all of them have no filesize
468476
if info.get('was_live'):

0 commit comments

Comments
 (0)