• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login

Take and Scrape Your Own Screenshots

Scheduled Pinned Locked Moved Ideas and Development
retroarchscreenshotscrapesselphruncommand
122 Posts 8 Posters 66.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    meleu @gomisensei
    last edited by meleu 29 Aug 2016, 02:52

    @gomisensei
    It worked fine for me. Let's see what is happening...

    According to what you said, it's failing on this test:

    if ! [[ -f "$screenshot_dir/$image" ]]; then
    

    Can you paste here the output of ls -l ~/RetroPie/roms/arcade/images/*.png?

    [EDIT: you are right, everything is set correctly. Otherwise the script would interrupt before and with other log messages. I'm suspecting of file names...]

    • Useful topics
    • joystick-selection tool
    • rpie-art tool
    • achievements I made
    G 1 Reply Last reply 29 Aug 2016, 04:11 Reply Quote 0
    • M
      meleu @gomisensei
      last edited by 29 Aug 2016, 04:08

      @gomisensei
      I reproduced your problem. I've just realized that the if statement doesn't recognize the tilde ~ symbol as the home directory! Look:

      pi@retropie:~ $ [[ -d "~/RetroPie" ]] && echo directory exists
      pi@retropie:~ $ [[ -d "/home/pi/RetroPie" ]] && echo directory exists
      directory exists
      pi@retropie:~ $ 
      

      Well, to make it work for you, change your screenshot_directory in the respective retroarch.cfg to /home/pi/RetroPie/...

      I'll update the wiki mentioning this issue. Thanks for your feedback!

      • Useful topics
      • joystick-selection tool
      • rpie-art tool
      • achievements I made
      H G 3 Replies Last reply 29 Aug 2016, 04:12 Reply Quote 0
      • G
        gomisensei @meleu
        last edited by 29 Aug 2016, 04:11

        @meleu maybe you could add (if just for debug), exactly what filename the script is looking for and not finding? also, is it supposed to save a copy of the es gamelist to your rom dir? or is that just temporary? would i need to manually move it to the es gamelist dir when ES quits, so it won't be overwritten on exit?

        M 1 Reply Last reply 29 Aug 2016, 04:31 Reply Quote 1
        • H
          herb_fargus administrators @meleu
          last edited by 29 Aug 2016, 04:12

          @meleu you may want to use an environment variable rather than hardcoding if you want it to work irrespective of the platform: e.g. [[ -d "$HOME/RetroPie" ]]

          If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

          Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

          M 1 Reply Last reply 29 Aug 2016, 04:22 Reply Quote 0
          • G
            gomisensei @meleu
            last edited by 29 Aug 2016, 04:19

            @meleu i didn't use the ~ in my config file, but retroarch changed it from home/pi/ to ~/

            1 Reply Last reply Reply Quote 0
            • M
              meleu @herb_fargus
              last edited by 29 Aug 2016, 04:22

              @herb_fargus but the script must get the directory from retroarch.cfg screeshot_directory. The user can put any valid path there.

              @gomisensei I used /home/pi and it works fine here...

              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              G 1 Reply Last reply 29 Aug 2016, 04:26 Reply Quote 0
              • G
                gomisensei @meleu
                last edited by 29 Aug 2016, 04:26

                @meleu just re-entered the first line in arcade/retroarch.cfg as screenshot_directory = "/home/pi/RetroPie/roms/arcade/images", saved, then when i ran retroarch, it changed the /home/pi/ to ~/ again as soon as i exited...

                M 1 Reply Last reply 29 Aug 2016, 04:32 Reply Quote 0
                • M
                  meleu @gomisensei
                  last edited by 29 Aug 2016, 04:31

                  @gomisensei said in Take and Scrape Your Own Screenshots:

                  @meleu maybe you could add (if just for debug), exactly what filename the script is looking for and not finding?

                  good point. I'll change it.

                  is it supposed to save a copy of the es gamelist to your rom dir? or is that just temporary?

                  It's the real intention. Because if the user want to go back the only thing to do is to delete this file and emulationstation will get the gamelist.xml from ~/.emulationstation/gamelist/SYSTEM/gamelist.xml. Look the precedence order here: https://github.com/RetroPie/EmulationStation/blob/master/GAMELISTS.md

                  would i need to manually move it to the es gamelist dir when ES quits, so it won't be overwritten on exit?

                  No. It'll be "overwritten" (maybe "updated" fits better) only if "save metadata on exit" is on. And it doesn't remove entries, it just updates the last played and times played info (not sure if it updates more info).

                  • Useful topics
                  • joystick-selection tool
                  • rpie-art tool
                  • achievements I made
                  1 Reply Last reply Reply Quote 0
                  • M
                    meleu @gomisensei
                    last edited by meleu 29 Aug 2016, 04:32

                    @gomisensei said in Take and Scrape Your Own Screenshots:

                    @meleu just re-entered the first line in arcade/retroarch.cfg as screenshot_directory = "/home/pi/RetroPie/roms/arcade/images", saved, then when i ran retroarch, it changed the /home/pi/ to ~/ again as soon as i exited...

                    Are you using save_config_on_exit = "true"?

                    [EDIT: the script must deal with it anyway. I'll update it and let you know when it is ready.]

                    • Useful topics
                    • joystick-selection tool
                    • rpie-art tool
                    • achievements I made
                    G 1 Reply Last reply 29 Aug 2016, 04:52 Reply Quote 0
                    • H
                      herb_fargus administrators @meleu
                      last edited by 29 Aug 2016, 04:36

                      @meleu ah i didnt realise it was something the user set. nvm then. carry on

                      If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

                      Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

                      1 Reply Last reply Reply Quote 0
                      • G
                        gomisensei @meleu
                        last edited by gomisensei 29 Aug 2016, 04:52

                        @meleu tried it with "save on exit" set to false, now retroarch doesn't change it to ~, and no error in the runcommand. The gamelist.xml in my roms dir now has 2 entries for the game i screenshotted, one without the <image> and one (at the end of the file) with the <image>, but lost the <name> data, which was replaced with the romname.

                        I'm using -lr-fba-next running out of the "arcade" section, to try and screenshot "99lstwar.zip", which the name for is "99: The Last War". Before running the script, ES showed the correct full name; after running it, i have my screenshot, but it's listed as "99lstwar"

                        manually copied the gamelist.xml,

                        edit: guess the last was an unnecessary step, but I tried with another game, same result.

                        2nd edit: lost the descriptions also

                        M 2 Replies Last reply 29 Aug 2016, 05:16 Reply Quote 0
                        • M
                          meleu @gomisensei
                          last edited by meleu 29 Aug 2016, 05:16

                          @gomisensei
                          I've updated the script to deal with the tilde ~ and to print the full path file name to the image as you suggested.
                          You can get it again:

                          wget https://raw.githubusercontent.com/meleu/src/master/screeper.sh
                          mv screeper.sh /opt/retropie/configs/all/runcommand-onend.sh

                          The gamelist.xml in my roms dir now has 2 entries for the game i screenshotted, one without the <image> and one (at the end of the file) with the <image>

                          Yeah. I've noticed it when trying to reproduce your issue. I will work on it.

                          I'm using -lr-fba-next running out of the "arcade" section, to try and screenshot "99lstwar.zip", which the name for is "99: The Last War". Before running the script, ES showed the correct full name; after running it, i have my screenshot, but it's listed as "99lstwar"

                          Oh. I developed and tested the script only with the classics consoles, it was easy because they are used to use the ROM file name. The arcade games use the complete name of the game in ES. I'll try to adapt the script to deal with it.

                          2nd edit: lost the descriptions also

                          Do you mean the script deleted your metadata? I can't see how it can do this.

                          Thanks for your detailed feedback!

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          G 1 Reply Last reply 29 Aug 2016, 05:29 Reply Quote 0
                          • G
                            gomisensei @meleu
                            last edited by gomisensei 29 Aug 2016, 05:29

                            @meleu said in Take and Scrape Your Own Screenshots:

                            mv screeper.sh /opt/retropie/configs/all/runcommand-onend.sh

                            I'll test in tmrw, bedtime now.

                            didn't delete my metadata, just added a second entry into the gamelist without the previously saved metadata, and ES only seems to read the last one, so my scraped <name> and <desc> are in the first entry, but not in the script-written one.

                            M 2 Replies Last reply 29 Aug 2016, 05:31 Reply Quote 0
                            • M
                              meleu @gomisensei
                              last edited by 29 Aug 2016, 05:31

                              @gomisensei
                              Got it. I'm trying to solve this. Thanks!

                              • Useful topics
                              • joystick-selection tool
                              • rpie-art tool
                              • achievements I made
                              1 Reply Last reply Reply Quote 0
                              • M
                                meleu @gomisensei
                                last edited by 29 Aug 2016, 05:39

                                @gomisensei
                                Man! I've just discovered that the arcade game names are hardcoded on ES code! If it doesn't find the info from the gamelist.xml it gets from the ES itself!

                                https://raw.githubusercontent.com/RetroPie/EmulationStation/master/es-app/src/MameNameMap.cpp

                                Just sharing this curious info. I'm still trying to find a workaround to our issue. :-)

                                • Useful topics
                                • joystick-selection tool
                                • rpie-art tool
                                • achievements I made
                                1 Reply Last reply Reply Quote 0
                                • M
                                  meleu @gomisensei
                                  last edited by 29 Aug 2016, 14:36

                                  @gomisensei said in Take and Scrape Your Own Screenshots:

                                  I'm using -lr-fba-next running out of the "arcade" section, to try and screenshot "99lstwar.zip", which the name for is "99: The Last War". Before running the script, ES showed the correct full name; after running it, i have my screenshot, but it's listed as "99lstwar"

                                  I updated the script to avoid it. Worked fine in my tests. Can you see if it works for you?

                                  I'll work on the other issue ASAP (duplicated entries in gamelist.xml). Thanks!

                                  • Useful topics
                                  • joystick-selection tool
                                  • rpie-art tool
                                  • achievements I made
                                  G 1 Reply Last reply 29 Aug 2016, 23:24 Reply Quote 0
                                  • G
                                    gomisensei @meleu
                                    last edited by 29 Aug 2016, 23:24

                                    @meleu they're both the same problem, rather than find an existing entry, and add the image tag, it creates a whole new entry, (which is probably fine for console titles, but not Arcade). Still does it, but it works with the ~ dir now...

                                    I can probably rescrape after I get all the pics done, and my names/descs will be back.

                                    M 1 Reply Last reply 29 Aug 2016, 23:36 Reply Quote 0
                                    • M
                                      meleu @gomisensei
                                      last edited by 29 Aug 2016, 23:36

                                      @gomisensei said in Take and Scrape Your Own Screenshots:

                                      I can probably rescrape after I get all the pics done, and my names/descs will be back.

                                      Please, keep in mind that the script doesn't mess with your original gamelist.xml. If you want to undo what the method 2 did, it's pretty easy. Look here:
                                      https://github.com/RetroPie/RetroPie-Setup/wiki/Take-and-Scrape-Your-Own-Screenshots#i-didnt-like-how-it-looks-i-want-my-old-images-back-and-disable-this-stuff

                                      • Useful topics
                                      • joystick-selection tool
                                      • rpie-art tool
                                      • achievements I made
                                      G 1 Reply Last reply 30 Aug 2016, 00:05 Reply Quote 0
                                      • G
                                        gomisensei @meleu
                                        last edited by 30 Aug 2016, 00:05

                                        @meleu Yes, but if i scrape without downloading images, and point the scraper to my image dir, it will use the screenshots made with method2, and reset the other metadata.

                                        M 2 Replies Last reply 30 Aug 2016, 00:12 Reply Quote 0
                                        • M
                                          meleu @gomisensei
                                          last edited by 30 Aug 2016, 00:12

                                          @gomisensei said in Take and Scrape Your Own Screenshots:

                                          @meleu Yes, but if i scrape without downloading images, and point the scraper to my image dir, it will use the screenshots made with method2, and reset the other metadata.

                                          I got it. You are right.
                                          The problem happens because my script "detects" if the game is present in the gamelist.xml trying to find the "<image>...</image>" entry for this game. And it's proven that it is not the best idea.
                                          I'll try to find another approach.

                                          • Useful topics
                                          • joystick-selection tool
                                          • rpie-art tool
                                          • achievements I made
                                          1 Reply Last reply Reply Quote 0
                                          75 out of 122
                                          • First post
                                            75/122
                                            Last post

                                          Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                          Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                                            This community forum collects and processes your personal information.
                                            consent.not_received