-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[extractor/vk] playlist fix for new API requirements #6122
Conversation
Have you tested that the other code branches does not need this change? |
Yes, the other branches are for URLs, that either provide their own valid section id, or download an entire channel 'all'. Both of these are still what VK uses in their requests unchanged. I did however just notice, that I forgot to update the playlist test, so I fixed that. When doing so I also noticed, that most of the single video (VKIE) tests either fail for various reasons, or get skipped because the video has been removed. I think they were already failing months ago, but I am not sure. If you want me to, I can just update all of the tests in the extractor (either in this PR, or another one?) to make sure nothing there has been broken by this or an older API change |
Sure, you can do it in same PR |
- thumbnails do not need to be jpgs - removed tests, that tested for restrictions, or features that no longer exist - added test for clips - fixed audio extraction for wall posts
I updated all the tests and it seems like they did in fact change their site somewhere else. They changed their wallposts audio data to JSON and removed the url encryption, which crashed the previously already non-functioning audio extraction completely. I fixed that, but downloading still returned an error from the 'FFmpegFixupM3u8PP', because the audio stream is mp3 and not the expected aac. I changed the container to mov to hide the error for now. The files would however actually need a simple fixup, as they are currently only playable with a handful of media players. A real fix for this would be to have a url check in the fixup, to ommit the incompatible stuff: if all(self._needs_fixup(info)):
if 'vkuseraudio.net' in info['url']:
self._fixup('Fixing MPEG-TS in MP4 container', info['filepath'], [
*self.stream_copy_opts(), '-f', 'mp4'])
else:
self._fixup('Fixing MPEG-TS in MP4 container', info['filepath'], [
*self.stream_copy_opts(), '-f', 'mp4', '-bsf:a', 'aac_adtstoasc']) but that seems like an inelegant way to do this and I am not familiar enough with the codebase to come up with a better alternative. For now you would either have to play the files in something like mpv, or use -x to extract the actual audio manually. VK also lifted a lot of restrictions to being registered, so a lot of tests for edge cases are no longer required and some don't need to be skipped anymore. All tests succeed now |
If it's mp3, what kind of fixup does it need? |
Great, the files are playable and have no corruptions. |
My bad. Reverted |
When doing final testing, I noticed, that irrelevant reaction clips in the comments will also be picked up. That seemed like a bug to me, so I fixed that by only searching for videos in the actual post body. Otherwise everything should be good |
Authored by: the-marenga Closes yt-dlp#6219
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
As reported here, VK playlist downloads stopped working. The reason is, that their API has been changed yet again and now requires "playlist_ID" instead of just "ID" as a request parameter. With this fix everything works again
Fixes #4930 (comment)
PLEASE FOLLOW THE GUIDE BELOW
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?