Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Import youtube-dl for own script #308
Comments
|
Thanks for your comment. That works nicely. However, how can I determine the flv video after it was downloaded and move it with shutil.move into my desired directory? EDIT: I think I found a solution using glob. Here is the code.
|
|
Hi, glad to hear that it is working. Anyway, I moved your code to a gist and I am modifying it to read the destination from the program output. That would be a far more robust approach. I look forward to you publishing your work, feel free to ask if in need. |
|
Done on https://gist.github.com/2047687 |
|
Thanks for your input! I came up with another idea. Why not downloading the videos in the directory of the playlist? This would solve the problem as well. Have a look at the version here: https://github.com/orschiro/YYTubeGrabber/blob/master/yytubegrabber.py Still a bit messy is that I have to copy youtube-dl into every playlist directory. Better would be to check if it is installed before doing the copy process. I do not know how to check that though. Furthermore a kind of synchronisation with the playlist would be nice. Hence, delete the videos that are no longer part of the playlist on YouTube. However, I guess that's impossible to check. Regards |
|
I have to come back to my issue. Current code: https://github.com/orschiro/YYTubeGrabber/blob/master/yytubegrabber.py In this case only Playlist Lessons should be fetched since the others are commented out. However, after downloading all videos from that playlist youtube-dl continues to download videos which are not even on that playlist but belong to my uploads of my account. I cannot reproduce that behaviour. Any ideas why this happens? |
|
You are affected by #277 because you've taken youtube-dl.py before 7151f63. |
|
And I was believing my code is somehow wrong. Thanks for that hint, it works flawlessly now! Regards, Robert |
|
Hey there orschiro! I think I've actually written exactly what you are searching for: batch-youtube-dl.py. I'm not claiming that my code is perfect but maybe you can use or possibly learn something from it. A possible use case would be having a directory structure similar to this: Please note that the script requires you to have the |
|
Wow nice. I'll definitely take this as inspiration since my grabber is just a project to learn understanding Python better. Thanks! |
|
Hi, I realise this is an old thread but I came here a few days ago looking for a solution to the same problem. Not content with using subprocess I wrote a small api for youtube downloads. I would have contributed it directly to this project but the codebase is hard for me to follow! Please feel free to steal / improve / correct / criticise etc! |
|
Thanks! This is exactly what I was hoping for here... |
|
This has been possible for some time, it's documented in the README. If you have any problem/suggestion feel free to open a new issue. |
Hello,
It's not really regarded as an issue but I'd really appreciate a slight point of help in the right direction.
Learning and understanding Python a bit better I wanted to write a custom script that takes name and playlist URL out of a text file and should pass that to youtube-dl with the parameters 'cit'.
This is my small code snippet:
root_folder = 'C:/Users/Robert/Videos/YouTube/Playlists'
def download():
files = open('Playlists.txt').readlines()
for playlist in files:
p = playlist.split(';')
# Now run youtube-dl, pass the URL from p[1] and the destination folder from p[0] which should reside in root_folder.
download()
Playlist.txt looks like this:
Acoustic;http://www.youtube.com/playlist?list=PL5547214A7D5E1A26&feature=view_all
How do I run youtube-dl from within my script?
Regards