proghodet Posted May 4, 2020 Share Posted May 4, 2020 (edited) I'm one of the few who doesn't have a subscription to emumovies, but i wanted to share my method for getting videos for LaunchBox. YouTube has longplays of a vast majority of the games that I need, so I created a script to download videos from there. It is a bit time consuming, and may require some technical know-how. If it's too much hassle, you may consider a subscription from emumovies instead ?♂️ Prerequisites: You need to install the following programs: Python* - ffmpeg - youtube-dl Add all the programs to your path (guide) * Python needs to be version 3.7. Didn't work with 3.8, for whatever reason. Optional: I recommend using a text editor, such as Notepad++, Visual Studio Code, Atom, or something like that. You can also use Notepad, but not a text processor such as Microsoft Word. How to: With all programs installed and added to your path, go to a folder where you'd like to download videos. Right click, and choose new -> text document. Rename the file to "script", and be sure that the file extension is .py (e.g: script.py). Open the document with your favorite text editor (if you don't have one, use notepad). Paste the code below: import subprocess import re # how long the videos will be; two minutes. video_duration = "00:02:00.00" videos = [ # Duplicate this line: {"title": "Mega Man X", "youtube_url": "https://www.youtube.com/watch?v=0qMDQTF8uVQ", "start_time": "00:03:30.00"}, ] # no touchy: for video in videos: links = subprocess.check_output(['youtube-dl', '-g', video["youtube_url"]]).splitlines() video_url = re.findall(r"'(.*?)'", str(links[0]), re.DOTALL) audio_url = re.findall(r"'(.*?)'", str(links[1]), re.DOTALL) print(subprocess.check_output(['ffmpeg', '-ss', video["start_time"], '-i', video_url, '-ss', video["start_time"], '-i', audio_url, '-t', video_duration, '-c', 'copy', video["title"] +".mp4"])) I have added an example video (mega man x). Duplicate this line, and edit it as you see fit. You can add as many videos as you'd like - I have tried with 70 videos, and it worked fine. {"title": "Mega Man X", "youtube_url": "https://www.youtube.com/watch?v=0qMDQTF8uVQ", "start_time": "00:03:30.00"}, - Set the game title - it should be the same as the game title in LaunchBox. - Add a link to the youtube video*. - Choose where in the video it should start recording from. (The syntax is HH:MM:SS.mm, so hour, minute, seconds, milliseconds) * If the youtube-link has an & inside it, be sure to remove everything behind it, including the &. e.g: If the link is: https://www.youtube.com/watch?v=TB6fwRRCzk8&list=PLpxuazQ7SB4wt7r_2BIxG0fDBtlcW-n5p Make it: https://www.youtube.com/watch?v=TB6fwRRCzk8 When you have added all the videos you want, you can run the script In order to do that we need to use the windows command prompt. Open it by pressing the windows-key, and write cmd, and then press enter. Finally, we can run the script: python c:\wherever\script\is\script.py If you have done everything right, you should now be downloading all the videos you added. Lastly, just move the files from the script-folder to the correct path the LaunchBox folder, eg. LaunchBox\Videos\Sony Playstation\ Feel free to ask questions! Edited May 4, 2020 by proghodet Quote Link to comment Share on other sites More sharing options...
drseussicide Posted July 2, 2020 Share Posted July 2, 2020 (edited) you can also just us "SKraperUI" out of the box to get videos just make sure it doesn't save a gamelist as it's not update frequently and "corrupts" the gamelists. https://www.skraper.net/ i genrally use launchbox for everything but videos and the come through with skraper and get the videos Edited July 2, 2020 by drseussicide 3 1 Quote Link to comment Share on other sites More sharing options...
Chris Kant Posted July 2, 2020 Share Posted July 2, 2020 16 minutes ago, drseussicide said: you can also just us "SKraperUI" out of the box to get videos just make sure it doesn't save a gamelist as it's not update frequently and "corrupts" the gamelists. https://www.skraper.net/ i genrally use launchbox for everything but videos and the come through with skraper and get the videos thank you. this is awesome and exactly what I expected for the Launchbox Games Database. 1 Quote Link to comment Share on other sites More sharing options...
drseussicide Posted July 2, 2020 Share Posted July 2, 2020 just make sure you don't let it save game lists and read it's settings thoroughly. it's really powerful and not super fast. it sucks to wait for it to finish only to find out it was set wrong somewhere. i'd suggest doing a smaller system first by itself to make sure you like the result. Quote Link to comment Share on other sites More sharing options...
2phenix9 Posted September 5, 2020 Share Posted September 5, 2020 also with downloading youtube videos, you can also use an IDM called jdownloader2. and its literally as easy as right clicking the link and sometimes choosing copy or the jdownloader will auto grab the link and in the grabber tab you will see in a folder called "various files" or even just be there and you will find direct download links for all outputs of that video ready to download. its so much easier and quicker and how i grab videos i cant find via launchbox Quote Link to comment Share on other sites More sharing options...
proghodet Posted October 3, 2020 Author Share Posted October 3, 2020 There are plenty of ways to download from youtube, however most of them download the whole file as-is. Most game videos that I would like are longplays, which may be up to 4 hours long, when I just need it cut to 2 minutes. I am a developer and am used to working this way, but I understand that it's not for everyone. I suppose a GUI would make it more user friendly, but .. priorities 1 Quote Link to comment Share on other sites More sharing options...
grim. Posted October 6, 2020 Share Posted October 6, 2020 Maybe this is what I'm looking for. I have Emumovies and still recommend it, but it doesn't have everything and I'd like to grab a few seconds of YouTube gameplay for games. Every other solution involves downloading the entire video first or using a free website to clip a portion of the video. It'll take a while to do that way. 1 Quote Link to comment Share on other sites More sharing options...
grim. Posted October 17, 2020 Share Posted October 17, 2020 Need some help here: To simplify things, in my gaming hard drive I created one folder for all of this, "Video Snaps". In both the System variables and User variables under PATH, I added only two lines for each: "F:\Video Snaps" and "C:\Users\TheBi\AppData\Local\Programs\Python\Python37". I run CMD under administrator mode and type: >python F:\Video Snaps\script.py It doesn't find it because of the spaces >python "F:\Video Snaps\script.py.txt" I get a huge wall of text with a red line saying "No such file or directory." Quote Link to comment Share on other sites More sharing options...
dragon57 Posted October 18, 2020 Share Posted October 18, 2020 Have you tried: >python "F:\Video Snaps\script.py" Quote Link to comment Share on other sites More sharing options...
grim. Posted October 18, 2020 Share Posted October 18, 2020 Yes. Results: python: can't open file 'F:\Video Snaps\script.py': [Errno 2] No such file or directory Quote Link to comment Share on other sites More sharing options...
proghodet Posted October 18, 2020 Author Share Posted October 18, 2020 (edited) try running it as python3 "F:\Video Snaps\scrypt.py" It seems your default python version is 2.7, and it needs to use python 3.7 Also, your file has been named script.py.txt, but it should be script.py. Windows adds the .txt extension for whatever reason. Just right click the file -> Rename -> remove the .txt part Edited October 18, 2020 by proghodet Quote Link to comment Share on other sites More sharing options...
grim. Posted October 18, 2020 Share Posted October 18, 2020 (edited) I got nothing from it (picture below). Should I do something to make 3.7 my default python somehow? Your ffmpeg.exe link was broken for me. Apparently that site shut down last month. But I already had an ffmpeg.exe from another thing I don't remember so I copied it here. Hopefully whatever version I have doesn't matter. (Edit: I replaced it with latest version, 4.3.1-2020-10-01 , and no effect.) Edited October 18, 2020 by grim. Quote Link to comment Share on other sites More sharing options...
proghodet Posted October 18, 2020 Author Share Posted October 18, 2020 Where did you install python 3.7? You can actually just point to that specific installation. For me it is installed at: C:\Users\Server\AppData\Local\Programs\Python\Python37-32 Find that folder in explorer. Open a command prompt, write cd and drag the folder into the window cd C:\Users\Server\AppData\Local\Programs\Python\Python37-32 Now you run the script using that version of python: .\python.exe "F:\Video Snaps\script.py" To answer your question, yes, there is a way to set 3.7 as your default, but that involves messing with your path variables press win+r, and write sysdm.cpl, and press enter. Then, go to Advanced -> Environment Variables (at the bottom) Double click the row that says Path, and add the folder from above in there: Hope that helps Quote Link to comment Share on other sites More sharing options...
grim. Posted October 18, 2020 Share Posted October 18, 2020 (edited) I typed what you wrote exactly, .\python.exe "F:\Video Snaps\script.py" and I also typed the previous python "F:\Video Snaps\script.py" just in case you made a typo. Neither worked. Then, just out of curiosity, I added .txt to the filename in the command and got this enormous wall of text. Let me know if it's nothing and I need to stop trying the txt extension. Edited October 18, 2020 by grim. Quote Link to comment Share on other sites More sharing options...
grim. Posted October 18, 2020 Share Posted October 18, 2020 Update: Progress. It turns out that Mega Man X ended up in my Python folder. Well this is gonna suck. Any idea how to redirect it to the folder I made? 1 Quote Link to comment Share on other sites More sharing options...
proghodet Posted October 18, 2020 Author Share Posted October 18, 2020 (edited) progress is good! The script file would need to be renamed (i.e, remove the .txt extension) before you can call it as script.py - but whatever works I guess It will put the files in whatever directory you are in when you call the script. It seems that you have fixed the path-issue, so you should be able to do this cd "F:\Video Snaps\" python script.py.txt And the files should end up in the correct folder Edited October 18, 2020 by proghodet Quote Link to comment Share on other sites More sharing options...
grim. Posted October 18, 2020 Share Posted October 18, 2020 (edited) Wow, Command Prompt will not change directory. Notice how I try two different commands to change the directory to Video Snaps but it didn't work. Changing to Python had no issues. By the way, it's 5:25am so I'm going to bed right now but I'll read this thread later. Edited October 18, 2020 by grim. Quote Link to comment Share on other sites More sharing options...
proghodet Posted October 18, 2020 Author Share Posted October 18, 2020 Since it's another drive, you need to do this: F: cd "Video Snaps" Give yourself a pat on the back for being so patient Quote Link to comment Share on other sites More sharing options...
grim. Posted October 18, 2020 Share Posted October 18, 2020 Finally! It worked! F: cd "Video Snaps" python script.py <----- FAIL python script.py.txt <----- Wall of text and success. I won't fight the txt. It works and I don't care why. I'm creating a notepad file with those setup and script instructions for future use. Not forgetting this now! Tomorrow I put this thing to work. I need hundreds of videos. Thanks a bunch! This app would really help someone wanting to quickly create videos over at Emumovies. 1 Quote Link to comment Share on other sites More sharing options...
proghodet Posted October 18, 2020 Author Share Posted October 18, 2020 8 minutes ago, grim. said: python script.py.txt <----- Wall of text and success. I won't fight the txt. It works and I don't care why. I'll tell you why, anyway Go to view, and click File name extensions. This will make it so you see that darn txt-file for what it really is. What you have now is actually script.py.txt, which you will see when you check that box. Once thats done, you should be able to rename it to only script.py. The file type should then become a "Python source file", and not a "Text document" as it is now Anyway, as I said before - whatever works! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.