Are there any working Python YouTube APIs for downloading videos?
1 23 Sep 2019 15:02 by u/user9713
Background: YouTube doesn't allow you to download videos through their API, but people still find a way.
Anyway, I wrote a Python script that uses PyTube. I pretty much had it all done, until it was time to download the video. Turns out, it has some issues downloading certain formats, getting a 404 error when attempting to download. From my research, it's because YouTube ciphers the URL to the video formats and it requires knowing the regex patterns to decipher. I think this one has an old regex pattern and the Issues tracker on the GitHub that provided new regex patterns didn't fix the issue.
I know about PaFy, but I'm not certain it works, and I'm just wondering if someone here has tried it and can verify that it works flawlessly since I'd prefer not to waste time on something that doesn't work.
2 comments
0 u/carlip 23 Sep 2019 15:22
there is an autohotkey script that works really well
0 u/psimonster 23 Sep 2019 15:29
https://pypi.org/project/youtube_dl/
It installs a command line script but you could import the package and call the function that gets the file.