Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
youtube-dl
-
I ported youtube-dl to Pythonista - see the repo here. Please post all issues/bugs/ideas etc. there.
(I plan on updating it weekly from master.)
-
-
Yup, pudquick's is good - though it only supports YouTube. (He also has one for Grooveshark, if I'm not mistaken.)
This library supports many more sites. I find it especially useful for sites that still only have flash players - this gives you the ability to view those videos on your mobile device.
-
Hi @hyshai, thanks a lot for bringing youtube-dl to pythonista, easily I manage to do a python script with 2 workflows that download videos from youtube, facebook, etc. Do you have an easy way to keep updated the module from the repo?
-
@mncfre for now there isn't a way to update it automatically- you would just delete the current directory and reinstall. I plan on adding a script to do that for you (similar to StaSh's self-update).
-
Hi, I try extracting mp3 audio but it show an error "ffprobe or avprobe other found" can you help me please
-
@hyshai thanks for sharing this, but... what file should be run? There are so many. Or can you post an example usage? (noob question...)
-
@jmv38 download the whole youtube_dl directory to site-packages, then write your own script or copy one of the examples into a new script.<br />
@hyshai: great, thank you. -
@Brumm could you post a 1or 2 line script that downloads just one video? For an example showing how to use this great code.
Okay, i probably sound like a moron for you, but i cant find any example in the given scripts. I am not python - fluent, so this doesnt seem obvious to me. Thanks -
-
@jmv38 I post an interface that use the library but it require Workflow for iOS https://omz-forums.appspot.com/pythonista/post/5864869278515200
-
@brumm thank you. I tried the first example. I have copied the youtube_dl in site packages, but still i get an error (Import error: no module named ctypes). I guess all that is way beyond me. Thanks anyway.
-
jmv, perhaps you could post a full traceback. I don't see where you'd get something trying to import ctypes...
hyshai... it seems like perhaps the only changes to youtube-dl to get it to work in pythonista is to remove the checks to
isatty()
, which don't exist in the existing pythonista sys.stdout, etc.Another approach might be -- create a custom
patch_isatty
, which does the following:sys.stdin.isatty = lambda : False sys.stdout.isatty = lambda : False sys.stderr.isatty = lambda : False
Then, people could simply
import patch_isatty
before importing youtube_dl. You might also provide an installation script, and an update script to update an existing installation (reloading the appropriate modules), which points to the rg3/master repo, so you don't have to constantly update this.. -
@JonB: Those are great ideas, I will implement them shortly. Thanks
-
@hyshai please can you help me making work the post processor of audio only?
-
@mncfre: Unfortunately, the built in options of ffmpeg, avconv won't work in Pythonista because they are C programs. Though you can use an external program to "extract" the audio - e.g. Workflow.
-
@hyshai sorry to hear that, I already did a workflow integration, I just want to avoid the workflow necessity, well at least using the 'bestaudio' format in YouTube links download only the audio, thanks a lot for your help
-
Technically, it might be possible to use https://bgrins.github.io/videoconverter.js/ in place of ffmpeg, but this would be amazingly slow. This is a version of ffmpeg compiled using emscripten.
You'd likely also need to create a way to spoon feed data, I sort of doubt you could pass 10s or hundreds of MB through eval_js.
-
Tanks a lot @JonB I'm going to check it.
-
@hyshai I thought you might be interested I have created a script that downloads youtube-dl from the original github page and makes the current changes to make it work in pythonista.
The changes were based on the changes you made to youtube-dl to make it work in pythonista.
You can check it out here if you are interested <a href="https://github.com/shaun-h/pythonista-youtubedl-downloader">https://github.com/shaun-h/pythonista-youtubedl-downloader</a>If anyone finds any issues please let me know.