Fix 403 "Access Denied" for encrypted videos #199
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Turns out, request without
playbackContext
and, in particular,signatureTimestamp
always lead to 403 "Access Denied" after decrypting signature. This value seems like doesn't change too often, so temporarily hard-coding it just to fix problem as soon as possible. But later need to fetch it from youtube.I don't know how often this
signatureTimestamp
changes, but i tried few different videos from different browsers and it was18795
every time. Probably should work at least until tomorrow.Its possible to get this value from player js (same as decipher options). Need to look for
sts
orsignatureTimestamp
(its stored several times). Though, this require a bit more changes in code (and possibly rearrangements), so i decided to make this small temporary fix for now.Also browser metadata isn't mandatory for request, instead its better to specify language so server responses always be same instead of server changing response language based on your ip.
Issues to fix
Please link issues this PR will fix:
#198 (comment)
if no relevant issue, but this will fix something important for reference
, please free to open an issue.
Reminding
Something you can do before PR to reduce time to merge