Jump to content
LaunchBox Community Forums

Alternative to EmuMovies


proghodet

Recommended Posts

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 by proghodet
Link to comment
Share on other sites

  • 1 month later...
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. 

  • Like 1
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 4 weeks later...

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 :)

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

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."

scripts.JPG

Link to comment
Share on other sites

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 by proghodet
Link to comment
Share on other sites

I got nothing from it (picture below).

  1. Should I do something to make 3.7 my default python somehow?
  2. 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.)

 

 

scripts.JPG

Edited by grim.
Link to comment
Share on other sites

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.
image.png.f48c1ee714a5e899f82b638ec1c3a36c.pngThen, go to Advanced -> Environment Variables (at the bottom)

Double click the row that says Path, and add the folder from above in there:
image.thumb.png.5957381072f23b650cd5e62a01ef884a.pngHope that helps :)

Link to comment
Share on other sites

  1. 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.
  2. 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.

scripts2.thumb.JPG.e2538fc092c60456a0ff14d30a648014.JPG

Edited by grim.
Link to comment
Share on other sites

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 by proghodet
Link to comment
Share on other sites

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.

scripts.JPG

Edited by grim.
Link to comment
Share on other sites

Finally! It worked!

  1. F:
  2. cd "Video Snaps"
  3. python script.py  <----- FAIL
  4. 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.

  • Game On 1
Link to comment
Share on other sites

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 :D

image.thumb.png.0681b34a9125ded5ba519323648994ac.pngGo to view, and click File name extensions. This will make it so you see that darn txt-file for what it really is.
image.png.19e8d1d7b2cdbc7741c1ebf0048fc8fc.pngWhat 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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...