Jump to content
LaunchBox Community Forums

Launchbox-RetroPie-Batocera-Miyoo Export 1.2.2

   (0 reviews)

5 Screenshots

About This File

Launchbox is great, but it doesn't run on linux. RetroPie is great, but the scraper is terrible. This script will copy your roms, metadata and images from LaunchBox for use with RetroPie (or Batocera/Miyoo). If desired, it will also reduce the size of the copied images to make them load faster on the Pi. Edit the attached file to choose your platforms, and decide if you want everything, or only your favourites.

If selecting Batocera XML format it will attempt to copy the first box art, marquee, screenshot and video file for each of your titles.

If selecting the Miyoo Onion OS XML format the gamelists will be called miyoogamelist.xml and the boxart will be reduced to 250px and converted to PNG. See their github for more info.

How to Install:

  1. Download and install Python
  2. Choose All Users and add it to your Path
  3. Open cmd, and type 'pip install Pillow'
  4. Download the attached file and edit it accordingly (specify your LaunchBox folder, desired output folder and platforms)
  5. Run 'python launchbox_retropie_export.py'
  6. Transfer the files to your Pi using WinSCP or similar
    • Copy the gamelists, roms and images to /home/pi/RetroPie/roms
  7. Enable the 'Parse Gamelists Only' option in EmulationStation

Edited by dingodan
1.2 update


What's New in Version 1.2.2   See changelog

Released

fixed typo

  • Like 11
  • Thanks 3
  • Unusual Gem 2

User Feedback

Recommended Comments



This part has me vexxed.  

  1. Open cmd, and type 'pip install Pillow'

What does this mean?  My command in windows does not understand the pip command.  I am confused and would love to use this tool!  

Thanks in advance anyone who might be able to help!

I have like, three guides up now on how to install pip, different pip downloads for different versions of python, this is getting quite complicated!

Edited by OnlyHuman
Link to comment
Share on other sites

See step 2: if pip isn't recognised it means Python and its tools are not in your system path variable. Pip is a python package manager that downloads and installs modules. Pillow is the image resize module I chose for making pi-friendly versions of larger images.

Python 3 installs by default to C:\Users\<User>\AppData\Local\Programs\Python\Python36 and pip is included in C:\Users\<User>\AppData\Local\Programs\Python\Python36\Scripts. Both folders should be added to the path environment variable.

Edited by dingodan
Link to comment
Share on other sites

I appreciate the response, got it working like a charm!  Thanks for the tool DingoDan!!!
 

Yup, for anyone looking for help. 

  

  • Like 1
Link to comment
Share on other sites

all i get is "no such file or directory" . Its having trouble with my rom location apparently. They all work from launchbox though

Link to comment
Share on other sites

I modified the file so that it would insert the XML for the video paths/names.  Seems to work, tested it on Atari 7800.  I am sure there is a more eloquent way to do it, but like I said it works.  If anyone is interested I attached it below.  

launchbox_retropie_export.py

  • Like 3
Link to comment
Share on other sites

On 10/26/2018 at 9:41 PM, JesseBlue said:

@ dingodan : Are you still working on this project?

I used it again recently, so it still works. But I'm not planning on adding more features anytime soon. Something you're after?

Link to comment
Share on other sites

On 10/28/2018 at 4:49 PM, Solo187 said:

all i get is "no such file or directory" . Its having trouble with my rom location apparently. They all work from launchbox though

@dingodan: I'm having the same problem, is there a specific folder location that the script is looking for? I have my ROMs in a directory outside of my Launchbox folder:

E:\
  ∟ Launchbox
  ∟ ROMS
  ...

My output is on a different drive, as well.

Link to comment
Share on other sites

@bvanwesten If you're getting no such file or directory from the command prompt python is probably not in your path variable (step 2). You can add it after setup by editing your system environment variables and adding the folder that contains python.exe.

Link to comment
Share on other sites

 

On 1/19/2019 at 3:56 PM, Omen said:

Does this also copy videos?

No, but @sdetert's does:

On 11/30/2018 at 1:30 AM, sdetert said:

I modified the file so that it would insert the XML for the video paths/names.  Seems to work, tested it on Atari 7800.  I am sure there is a more eloquent way to do it, but like I said it works.  If anyone is interested I attached it below.  

launchbox_retropie_export.py

 

Edited by Hifihedgehog
Link to comment
Share on other sites

Hi there. Has anyone got this working? I have python installed correctly and it's in my path etc. But it's not finding my roms, it only copies the images. I've tried the original script and the updated one that also does videos, both have the same result (screenshot attached).

Not a huge problem though, I can copy the roms manually, the images are what I want anyway. Thanks.

python errors 1.png

Link to comment
Share on other sites

2 hours ago, retrotry said:

Hi there. Has anyone got this working? I have python installed correctly and it's in my path etc. But it's not finding my roms, it only copies the images. I've tried the original script and the updated one that also does videos, both have the same result (screenshot attached).

Not a huge problem though, I can copy the roms manually, the images are what I want anyway. Thanks.

That's a new one. Is it possible you've added your roms into LB using a relative path? If your roms are under the same directory as LB under Games I could see this logic not working. The script is looking for the ApplicationPath value of each XML entry in the various Platforms XML. Here's one of mine, using an absolute path:

<ApplicationPath>Z:\Media\Roms\Nintendo\NES\Vegas Dream (USA).zip</ApplicationPath>

Quick way to test would be to back up your platform XMLs, do a find and replace on <ApplicationPath>Games\ then punch in the full path prefix, ie <ApplicationPath>C:\Apps\Launchbox\Games\

  • Like 1
Link to comment
Share on other sites

Indeed, thanks @dingodan, that's exactly what it was. I did a Find & Replace on the Atari 2600 xml in LB, then ran the script again. It still shows an error, but it does copy the images and roms now. Error says "image_path is not defined".

 

python errors 2.png

  • Game On 1
Link to comment
Share on other sites

Pretty sure that's the * in Q*bert messing it up for just that title. The script has to guess what the image filenames will be based on the game title. Probably adding a line for * would fix that, so lines 83-87 would become:

input = input.replace(":","_")
input = input.replace("'","_")
input = input.replace("/","_")
input = input.replace("*","_")

 

  • Like 1
Link to comment
Share on other sites

This script only works correctly if you do not have relative paths for images and videos and roms in your platform.xml. Shame. LB will only write video/image paths if you use it's own scraper to add media. If you use your own media downloaded by EM for example, nothing gets written, hence this script cannot work.

Link to comment
Share on other sites

 I'm not a python guy, but I do powershell and am in the process of testing out Batocera.  Media download is just ugly though.  Rather than re-downloading gigs of data, I'm going to write a PS script to migrate my stuff over.  I may even do this with workflows...  It may just all be a wasted effort, but it's fun to play around.

Rob

 

Link to comment
Share on other sites

Hey guys so this works only for media downloaded from the Launchbox scraper as mentioned above or also for collections added manually (image collections available on the LB forums)?

Does this also handle the fact that files are named  differently in Batocera?

Link to comment
Share on other sites

On 6/12/2023 at 5:12 PM, Kefka2b said:

Hey guys so this works only for media downloaded from the Launchbox scraper as mentioned above or also for collections added manually (image collections available on the LB forums)?

Does this also handle the fact that files are named  differently in Batocera?

It handles media that is present in the Launchbox XML, and copies/transforms it to the needed formats. Yes, it supports Batocera as an output.

  • Like 1
Link to comment
Share on other sites

This is so good. Any way to fix the import of media into gamelist.xml? It's not properly creating entries for marquee, video or image. The only one that works is thumbnail, and only if reduce_image_size = True. 

gamelist.xml ends up looking like: 
 

<gameList>
    <game>
        <path>./Mega Man X4.chd</path>
        <name>Mega Man X4</name>
        <desc>Taking place in an ambiguous year in the 22nd century (21XX) and following the third defeat of the &quot;Maverick&quot; robot Sigma, Cain Labs issues an initiative to create a supplementary military force to complement the &quot;Maverick Hunters&quot;. The army, called the &quot;Repliforce&quot;, is a strict regime led by General and his second-in-command, Colonel. Six months following the inception of the group, Cain Labs finds its methods to be ineffective, questionable, and potentially dangerous in the Maverick defense. To make matters worse, behind the scenes, General has been meeting with a mysterious figure who plots the Hunters' demise, insinuating that they are a significant threat to the jurisdiction of the Maverick Hunters. Mayhem breaks out when the Sky Lagoon, a massive floating city, is sent crashing down onto the city below it, killing millions of civilians, humans and Reploids alike. The game begins here where either X or Zero is dispatched to investigate possible causes of the disaster only to become entangled, once again, in a struggle against Sigma to save the world.</desc>
        <image/>
        <marquee/>
        <thumbnail>./images_boxart/Mega Man X4-01.png</thumbnail>
        <video/>
        <rating>0.0</rating>
        <releasedate>19970925T000000</releasedate>
        <developer>Capcom</developer>
        <publisher>Capcom</publisher>
        <genre>Platform; Shooter</genre>
        <players>1+</players>
    </game>

...


I added some more messages on the terminal so I could debug it, but I haven't found the issue yet. All I know is that the media files are being imported no problem, but when it comes to writing them to gamelist.xml, it acts as if those files don't exist. Also, it doesn't remove the -01 from filenames (not a big deal, just odd).

Image type: screenshot
Media Files Found:
Image type: marquee
Media Files Found:
Image type: box art
Media Files Found:
Image type: video
Media Files Found:
D:\LaunchBox\videos\Sony Playstation\Clock Tower Ghost Head -Yokubari--01.mp4
D:\LaunchBox\videos\Sony Playstation\Goemon Shin Sedai Shuumei.mp4
D:\LaunchBox\videos\Sony Playstation\King_s Field (US)-01.mp4
D:\LaunchBox\videos\Sony Playstation\King_s Field II-01.mp4
D:\LaunchBox\videos\Sony Playstation\Mega Man X4-01.mp4
D:\LaunchBox\videos\Sony Playstation\Mega Man X5-01.mp4
D:\LaunchBox\videos\Sony Playstation\Mega Man X6-01.mp4
D:\LaunchBox\videos\Sony Playstation\Resident Evil_ Director_s Cut-01.mp4
D:\LaunchBox\videos\Sony Playstation\Resident Evil_ Director_s Cut-02.mp4
D:\LaunchBox\videos\Sony Playstation\Spyro the Dragon-01.mp4
D:\LaunchBox\videos\Sony Playstation\Tomb Raider-01.mp4
Sony Playstation: Mega Man X4
        No screenshot found for Mega Man X4
        No marquee found for Mega Man X4
D:\Launchbox Rom Export\launchbox_retropie_export_symlink.py:153: DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
  resized_image = original_image.resize(size, Image.LANCZOS)
        No video found for Mega Man X4
[WinError 183] Cannot create a file when that file already exists: 'D:\\LaunchBox\\..\\Games\\Emulators\\PS1\\Games\\Mega Man X4.chd' -> 'D:\\Launchbox Rom Export\\roms\\psx\\Mega Man X4.chd'
Sony Playstation: Resident Evil: Director's Cut
        No screenshot found for Resident Evil: Director's Cut
        No marquee found for Resident Evil: Director's Cut
        No video found for Resident Evil: Director's Cut
[WinError 183] Cannot create a file when that file already exists: "D:\\LaunchBox\\..\\Games\\Emulators\\PS1\\Games\\Resident Evil - True Director's Cut - Dual Shock Ver. .chd" -> "D:\\Launchbox Rom Export\\roms\\psx\\Resident Evil - True Director's Cut - Dual Shock Ver. .chd"
----------------------------------------------------------------------
Created 1 gamelist XMLs and symlinked 2 media files from 0 games
----------------------------------------------------------------------

 

  • Like 1
Link to comment
Share on other sites

On 7/21/2023 at 5:32 PM, walter10h said:

This is so good. Any way to fix the import of media into gamelist.xml? It's not properly creating entries for marquee, video or image. The only one that works is thumbnail, and only if reduce_image_size = True. 

 

I had the exact same error. It seems like the save_image function does not create the output_path variable when you are not resizing the images. I could fix it for me by adding these two lines in line 165 (right after the last else statement in the save_image function):

filename = os.path.basename(r'%s' % original_path)
output_path = os.path.join(output_dir, filename)

so the complete else block should read like:

        else:
            filename = os.path.basename(r'%s' % original_path)
            output_path = os.path.join(output_dir, filename)
            copy(r'%s' % original_path, r'%s' % output_dir)
        return os.path.basename(output_path)    

I hope it helps

Edited by marzipant0rte
  • Thanks 1
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.
Add a comment...

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