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

403 error on most video downloads #65

Open
AlexanderBooth84 opened this issue Oct 11, 2024 · 7 comments
Open

403 error on most video downloads #65

AlexanderBooth84 opened this issue Oct 11, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@AlexanderBooth84
Copy link

I'm trying to download 1080p videos using the latest release but it seems to silently fail falling back to the 360p version no matter what settings I use.

Using the video_test.js example with no config changes but adding some console logging to the failed function in dl.js I'm seeing:

dl: failed - vformat=0, aformat=0 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=0, aformat=1 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=0, aformat=2 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=0, aformat=3 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=0, aformat=4 { msg: { msg: 'failed', fail: 'video', reason: 403 } }
dl: failed - vformat=1, aformat=0 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=1, aformat=1 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=1, aformat=2 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=1, aformat=3 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=1, aformat=4 { msg: { msg: 'failed', fail: 'video', reason: 403 } }
dl: failed - vformat=2, aformat=0 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=2, aformat=1 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=2, aformat=2 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=2, aformat=3 { msg: { msg: 'failed', fail: 'audio', reason: 403 } }
dl: failed - vformat=2, aformat=4 { msg: { msg: 'failed', fail: 'video', reason: 403 } }

I can't see how the recent changes would cause this so perhaps something has changed at the YT end?

@gatecrasher777
Copy link
Owner

Hi. Yes, another barrier from Youtube. There is a work around to this by spoofing an alternative client to the standard web client. I will push a PR soon.

@gatecrasher777 gatecrasher777 added the bug Something isn't working label Oct 18, 2024
@gatecrasher777
Copy link
Owner

PR #66 published.
Worked when testing. Let me know if it helps.

@AlexanderBooth84
Copy link
Author

The video downloads seem to work ok but only if you use a cookie and user-agent.

However the search functionality seems to be broken.

You can see this with the example application that yields the following.

node examples/search_test.js 
Session status: OK ()


Search for 100 videos with query: "soccer"
TypeError: Cannot read properties of undefined (reading 'twoColumnSearchResultsRenderer')
    at Search.fetch (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/lib/search.js:290:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runVideos (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/examples/search_test.js:42:2)
    at async run (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/examples/search_test.js:107:3)
Raw search json saved to ./examples/searchVideos.json

Search status: OK (No results)
Found 0 videos for "soccer"

Search info/videos saved to ./examples/search_videos.json


Search for 30 playlists
TypeError: Cannot read properties of undefined (reading 'twoColumnSearchResultsRenderer')
    at Search.fetch (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/lib/search.js:290:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runPlaylists (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/examples/search_test.js:62:2)
    at async run (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/examples/search_test.js:108:3)
Raw search json saved to ./examples/searchPlaylists.json

Search status: OK (No results)
Found 0 results for "soccer"

Search info/results saved to ./examples/search_playlists.json


Search for 50 channels
TypeError: Cannot read properties of undefined (reading 'twoColumnSearchResultsRenderer')
    at Search.fetch (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/lib/search.js:290:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runChannels (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/examples/search_test.js:82:2)
    at async run (/Users/russt/dev/src/zerolabs/gizmos/src/modules/ytcog/node_modules/ytcog/examples/search_test.js:109:3)
Raw search json saved to ./examples/searchChannels.json

Search status: OK (No results)
Found 0 channels for "soccer"

Search info/channels saved to ./examples/search_channels.json
Session complete.

@gatecrasher777
Copy link
Owner

Around the end of last month, Youtube started making it increasingly necessary to have a logged-in cookie to access video info. It is not a problem unique to ytcog.

As for search, there are quite a lot of similar problems in this project that I will patch shortly in v2.6

In the meantime, I am working on a new innertube project that will eventually replace this project.

@AlexanderBooth84
Copy link
Author

Thanks for the update. Your efforts are much appreciated. Great project.

@AlexanderBooth84
Copy link
Author

Hi @gatecrasher777 any news on v2.6 patch?

@AlexanderBooth84
Copy link
Author

@gatecrasher777 , do you know of any easy to implement workarounds for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants