-
Notifications
You must be signed in to change notification settings - Fork 13
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
Trying to fix ytsearch:, here's where I've got to #210
Comments
Youtube is just rolling out updates in a way that not everyone will instantly use the new version and that they update not all components at once as it's the case with search now. They use the Just look out for this
Especially the For search you would use
Where the key is the The Response is json. That will have another (new) It's quite an easy fix to implement. However I am missing the time currently to do so. There is a screenshot of history feed progress on Gitter (link) |
Seems youtube-dl just implemented this fix nice. Less work for me then :D |
Test command:
youtube-dlc ytsearch:lol --flat-playlist -J --verbose
For searches, youtube-dl/c tries to download some representation of the search page encoded as JSON which contains HTML strings, visible around
youtube.py:3289
:However when this code is executed the
_download_json
line fails because it tried to parse HTML as JSON. This is because the query parameter that youtube-dl/c was using,spf=navigate
, is now ignored by YouTube, so YouTube just returns an ordinary page of results.There may now be a different query parameter that gets the results in the same format, but if there is, I don't know what it is.
Otherwise we'll have to request the data from YouTube in a different format. Here's what I've got to on that:
and add these parameters to
_download_json
:Now you have a completely JSON representation of the results, which you can step into with:
Depending on the search terms, sometimes the
1
index is a0
.I don't have the energy to continue arranging the data into a format that the rest of the code likes. Hopefully someone can pick up from my work.
Peace.
The text was updated successfully, but these errors were encountered: