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



On 8/27/2023 at 5:27 PM, marzipant0rte said:

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

It works! It's a tad inconsistent with some games not saving video or screenshot. Hardly a big deal. It's very usable now. :D 

EDIT: Actually, the video path doesn't get added to gamelist.xml. Oh well. LOL


Thank you man!

Edited by walter10h
Link to comment
Share on other sites

Hey @dingodan so I tried the Mega Drive / Genesis export for Batocera, I am able to get the files (Roms/images/Videos) exported and then after transferring them to the Roms\megadrive folder in Batocera they are not being displayed in the games list, I reckon the Launchbox naming of the files doesn't work for Batocera? As downloading the box art manually renames it differently with appended text also to identify that it is a box art. Am I missing something in the export process?

Here is my script attached, help would be appreciated.

 

EDIT: Also attaching the generated XML it seems the files are not specified?

 

launchbox_retropie_export.py

gamelist.xml

Edited by Kefka2b
Link to comment
Share on other sites

Actually applied the bit from @marzipant0rte  adding those 2 lines to the script and now everything is populated apart from the video line (Not sure if there's a way to fix this?). You may want to to update the Downloadable script.

In any case thanks for your contribution ;)

Edited by Kefka2b
Link to comment
Share on other sites

Problem ("No video found for"...) 

You have to comment the three lines and than it will work:

false line 131, 132, 133

        if original_path.lower().endswith('mp4'):
            copy(r'%s' % original_path, r'%s' % output_dir)
            return

fixed:

    def save_image(original_path, output_dir):
        if not os.path.isdir(output_dir):
            os.makedirs(output_dir)
        #if original_path.lower().endswith('.mp4'):
            #copy(r'%s' % original_path, r'%s' % output_dir)
            #return
        if reduce_image_size:            
            try:

after that the "gamelist.xml" will include Videos:

        <video>./video/Meteorites-01.mp4</video>

instead of:

        <video/>
 

  • Thanks 1
Link to comment
Share on other sites

Thank you @dingodan for writing an sharing this script.
I made some modifications and added some functionality - namely:
- Added Manual exports
- Added 'Players' value from LB (instead of defaulting to "1+")
- Fixed some error handling
- Added functions to rename exported media, for platforms like ES-DE and GarlicOS that rely on the media files matching the ROM names 1:1.

I uploaded my version of the script here, hope you don't mind: https://github.com/thwonp/scripts/blob/main/launchbox-export.py

Edited by thwonp
  • Like 3
Link to comment
Share on other sites

>>thwonp
Thank you for creating it. But I can't run it.Please tell me.

1 . gamelist_dir = f'{output_dir}{'\\'}{'roms'}'   <<The last ' is displayed as an error.
2 . xmlfile = f'{gamelist_dir}{'\\'}{platform}{'\\'}{'gamelist.xml'}'  <<same error.

*****************
    gamelist_dir = f'{output_dir}{'\\'}{'roms'}'
                                                                          ^
SyntaxError: unexpected character after line continuation character
*****************

Windows11 japan
Python 3.6.3
Pollow(8.4.0)
pip(9.0.1)
 

Link to comment
Share on other sites

@Aki.M My environment is:

  • Python 3.12.2
  • Pillow 10.2
  • Pip 24.0

I suspect that updating your python version will fix it.

Edit: yep, the f-string syntax used here requires Python 3.12

Edited by thwonp
Link to comment
Share on other sites

>>thwonp

Thank you for your answer.
I was able to run it after updating the version.

thanks so much!!!

  • Game On 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...