Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 403 "Access Denied" for encrypted videos #199

Merged
merged 3 commits into from
Jun 22, 2021
Merged

Fix 403 "Access Denied" for encrypted videos #199

merged 3 commits into from
Jun 22, 2021

Conversation

Camelva
Copy link
Contributor

@Camelva Camelva commented Jun 22, 2021

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 was 18795 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 or signatureTimestamp (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

  • run "make build" to build the code
  • run "make format" to reformat the code
  • run "make lint" if you are using unix system
  • run "make test-integration" to pass all tests

Camelva added 3 commits June 22, 2021 11:35
…reTimestamp 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.

Also browser metadata isn't mandatory for request, instead its better to specify language so server responses always be same
… we need to re-use it.

Also declaring additional error for cases when we couldn't find sts
Also changing function signature because we need context now
@corny corny merged commit a3286f2 into kkdai:master Jun 22, 2021
@Camelva
Copy link
Contributor Author

Camelva commented Jun 22, 2021

@corny if i have additional thoughts about all this stuff, should i write it here or open new issue?

@corny
Copy link
Collaborator

corny commented Jun 22, 2021

I don't mind - what you prefer :-)

@Camelva
Copy link
Contributor Author

Camelva commented Jun 22, 2021

I don't mind - what you prefer :-)

Alright, this pr is already closed, so new issue it is :)

@Camelva Camelva deleted the innertube branch June 26, 2021 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants