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

    [SOFT] New Scraper in the works

    Scheduled Pinned Locked Moved Projects and Themes
    scrapingscrappersoftware
    253 Posts 7 Posters 72.3k 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.
    • kiroK
      kiro @Folly
      last edited by

      @Folly hi! I've been testing and I think I've found an issue, not sure why it is appearing now, but so be it. I've think I've fixed it, I'm testing some more and will update the tool ASAP. Will keep you informed. Thanks a lot for the report!!

      1 Reply Last reply Reply Quote 0
      • kiroK
        kiro @Folly
        last edited by

        @Folly Fix is the repository. Let me know if this solves your problems or not.

        Thanks one more time!

        FollyF 1 Reply Last reply Reply Quote 0
        • FollyF
          Folly @kiro
          last edited by Folly

          @kiro

          No change but I am doing the scraping from my script which uses the -rpie version.
          So you probably have to change some in there too.

          kiroK 1 Reply Last reply Reply Quote 0
          • kiroK
            kiro @Folly
            last edited by

            @Folly I've updated the -rpie version, are you sure you have the latest version from the repository? Thanks

            FollyF 1 Reply Last reply Reply Quote 0
            • FollyF
              Folly @kiro
              last edited by Folly

              @kiro

              I see you have just made a commit.
              I just tried again, same result.
              My script runs the retroscraper-rpie version "online" so it should be the latest.

              Did the dependencies change ?

              kiroK 1 Reply Last reply Reply Quote 0
              • kiroK
                kiro @Folly
                last edited by

                @Folly no, I did not change any dependencies...do you have somehow a cache enabled in your setup that would not get the latest version? Not sure...I'm scanning my whole collection again and it seems to be working fine....

                FollyF 1 Reply Last reply Reply Quote 0
                • FollyF
                  Folly @kiro
                  last edited by

                  @kiro said in [SOFT] New Scraper in the works:

                  do you have somehow a cache enabled in your setup that would not get the latest version?

                  No I haven't, I also did a re-run of the RetroPie-Setup script.

                  kiroK 1 Reply Last reply Reply Quote 0
                  • kiroK
                    kiro @Folly
                    last edited by

                    @Folly if you try to get retroscraper and run it locally, do you have the same problem?

                    FollyF 1 Reply Last reply Reply Quote 0
                    • FollyF
                      Folly @kiro
                      last edited by Folly

                      @kiro

                      I just did, with this command :

                      python3 retroscraper.py --systems arcade --relativepaths
                      

                      That works, I have videos now.

                      My script has a different command, will do that test also locally.

                      I tested this command, with similar options with the one in my script :

                      python3 retroscraper.py --systems arcade --recursive --relativepaths --mediadir media/emulationstation --nobackup
                      

                      That works locally too now.

                      kiroK 1 Reply Last reply Reply Quote 0
                      • kiroK
                        kiro @Folly
                        last edited by

                        @Folly cool, let me know how it goes.

                        FollyF 1 Reply Last reply Reply Quote 0
                        • FollyF
                          Folly @kiro
                          last edited by

                          @kiro

                          Running this locally also works :

                          curl https://raw.githubusercontent.com/zayamatias/retroscraper-remote/main/retroscraper.py|python3 - --systems arcade --recursive --relativepaths --mediadir media/emulationstation --nobackup
                          

                          From my script however it still has the same issue.
                          I will reboot my system to see if this will help.

                          kiroK 1 Reply Last reply Reply Quote 0
                          • kiroK
                            kiro @Folly
                            last edited by

                            @Folly yes, I totally forgot about the retroscraper -remote version, just uploaded the fix there too

                            FollyF 1 Reply Last reply Reply Quote 0
                            • FollyF
                              Folly @kiro
                              last edited by Folly

                              @kiro

                              Yea, I see it too now.
                              I was thinking also that it was the -rpie version but it's the remote indeed.
                              So It didn't have the fix yet.

                              I rebooted and now it works again, great.
                              But the reboot would not have been necessary, I believe now.

                              Very strange indeed that it somehow didn't work anymore but it seems it has been fixed ;-)

                              Thanks for fixing.
                              Good team work !

                              kiroK 1 Reply Last reply Reply Quote 0
                              • kiroK
                                kiro @Folly
                                last edited by

                                @Folly there seems to be an issue with the database and some video naming, I fixed the video naming conventions in the front-end, but still need some work in the backend. Thanks again! And yes, great teamwork!

                                Enjoy your weekend!

                                FollyF 3 Replies Last reply Reply Quote 0
                                • FollyF
                                  Folly @kiro
                                  last edited by

                                  @kiro said in [SOFT] New Scraper in the works:

                                  Enjoy your weekend!

                                  You too.

                                  1 Reply Last reply Reply Quote 0
                                  • FollyF
                                    Folly @kiro
                                    last edited by Folly

                                    @kiro

                                    Today I changed how the dependencies for retroscraper-remote are installed in my WIP mamedev.sh module-script as I wasn't happy about how it was.

                                    It took me quite some time to figure things out but I am quite happy with the result as it looks like it's a bit faster.

                                    This is the commit I made.

                                    This is how the function looks now :

                                    function retroscraper_remote_depends_mamedev () {
                                    	#install pip if the pip module is not installed
                                        if [[ $(su $user -c "python3 -m pip list" 2>&1) == *"No module named pip"* ]]; then
                                            su $user -c "wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py"
                                            su $user -c "python3 /tmp/get-pip.py"
                                        fi
                                    
                                        #update pip if there is a new release
                                    	[[ $(su $user -c "python3 -m pip list" 2>&1) == *"new release of pip"* ]] && su $user -c "python3 -m pip install --user --upgrade pip"
                                    
                                        #install python modules when not detected as installed
                                        #retroscraper-remote needs httpimport as extra library so some dependancies can be used "online"
                                        #https://stackoverflow.com/questions/23106621/replace-multiple-consecutive-white-spaces-with-one-comma-in-unix
                                    	local retroscraper_remote_module
                                    	local retroscraper_remote_modules=()
                                    	retroscraper_remote_modules=(
                                    	wheel==0.40.0
                                    	setuptools==67.7.2
                                    	googletrans==4.0.0rc1
                                    	Pillow==9.2.0
                                    	requests==2.21.0
                                    	httpimport==1.1.0
                                    	)
                                    	for retroscraper_remote_module in ${retroscraper_remote_modules[@]};do 
                                    	[[ $(su $user -c "python3 -m pip list|sed 's/ \{1,\}/==/g'") != *$retroscraper_remote_module* ]] && su $user -c "python3 -m pip install --user $retroscraper_remote_module"
                                    	done
                                    }
                                    

                                    I think you will find it interesting too.

                                    What is your opinion about also using a fixed version for wheel and setuptools ?

                                    If you have a question regarding this, then let me know.

                                    Edit :
                                    After testing it more it still seems that it's a bit slow on the raspberry pi.
                                    Will have a second look if I can improve it.

                                    1 Reply Last reply Reply Quote 0
                                    • FollyF
                                      Folly @kiro
                                      last edited by

                                      @kiro

                                      By changing the function slightly I doubled the speed.
                                      See this commit

                                      This is the function now :

                                      function retroscraper_remote_depends_mamedev () {
                                      	#install pip if the pip module is not installed
                                          if [[ $(su $user -c "python3 -m pip list" 2>&1) == *"No module named pip"* ]]; then
                                              su $user -c "wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py"
                                              su $user -c "python3 /tmp/get-pip.py"
                                          fi
                                      
                                          #update pip if there is a new release (2>&1 is used to redirect stderr to stdout so we can use the if function on the stderr info)
                                      	[[ $(su $user -c "python3 -m pip list" 2>&1) == *"new release of pip"* ]] && su $user -c "python3 -m pip install --user --upgrade pip"
                                      
                                          #install python modules when not detected as installed
                                          #retroscraper-remote needs httpimport as extra library so some dependancies can be used "online"
                                          #https://stackoverflow.com/questions/23106621/replace-multiple-consecutive-white-spaces-with-one-comma-in-unix
                                      	local pip_list_output
                                      	local retroscraper_remote_module
                                      	local retroscraper_remote_modules=()
                                      	retroscraper_remote_modules=(
                                      	wheel==0.40.0
                                      	setuptools==67.7.2
                                      	googletrans==4.0.0rc1
                                      	Pillow==9.2.0
                                      	requests==2.21.0
                                      	httpimport==1.1.0
                                      	)
                                      	#this command was the first test and filters out the required modules but has no speed advantage vs the used command
                                      	#pip_list_output=$(su $user -c "python3 -m pip list|sed 's/ \{1,\}/==/g'|awk \"/${retroscraper_remote_modules[0]}/ || /${retroscraper_remote_modules[1]}/ || /${retroscraper_remote_modules[2]}/ || /${retroscraper_remote_modules[3]}/ ||  /${retroscraper_remote_modules[4]}/ || /${retroscraper_remote_modules[5]}/\"")
                                      	pip_list_output=$(su $user -c "python3 -m pip list|sed 's/ \{1,\}/==/g'")
                                      	
                                      	for retroscraper_remote_module in ${retroscraper_remote_modules[@]};do 
                                      	[[ $pip_list_output != *$retroscraper_remote_module* ]] && su $user -c "python3 -m pip install --user $retroscraper_remote_module"
                                      	done
                                      }
                                      
                                      kiroK 1 Reply Last reply Reply Quote 0
                                      • kiroK
                                        kiro @Folly
                                        last edited by

                                        @Folly Hey thanks! Very useful indeed. I like the specific version switch, since sometimes newer versions of libraries have breaking changes.

                                        FollyF 2 Replies Last reply Reply Quote 0
                                        • FollyF
                                          Folly @kiro
                                          last edited by Folly

                                          @kiro said in [SOFT] New Scraper in the works:

                                          I like the specific version switch, since sometimes newer versions of libraries have breaking changes

                                          Sure, I think so too.
                                          I think you know but with this command you can list the outdated versions :

                                          python3 -m pip list --outdated
                                          

                                          So we can find the latest versions and update the versions one at a time in the function I made.
                                          That way we can test if a newer module version breaks the script.
                                          If not we can update the versions in the script.

                                          What do you think ?

                                          1 Reply Last reply Reply Quote 0
                                          • FollyF
                                            Folly @kiro
                                            last edited by Folly

                                            @kiro

                                            I updated all modules to the latest version.
                                            Only these 3 are changed : Pillow==9.5.0 requests==2.30.0 httpimport==1.3.0

                                            See this commit

                                            This is the function now :

                                            function retroscraper_remote_depends_mamedev () {
                                            	#install pip if the pip module is not installed
                                                if [[ $(su $user -c "python3 -m pip list" 2>&1) == *"No module named pip"* ]]; then
                                                    su $user -c "wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py"
                                                    su $user -c "python3 /tmp/get-pip.py"
                                                fi
                                            
                                                #update pip if there is a new release (2>&1 is used to redirect stderr to stdout so we can use the if function on the stderr info)
                                            	[[ $(su $user -c "python3 -m pip list" 2>&1) == *"new release of pip"* ]] && su $user -c "python3 -m pip install --user --upgrade pip"
                                            
                                                #install python modules when not detected as installed
                                                #retroscraper-remote needs httpimport as extra library so some dependancies can be used "online"
                                                #https://stackoverflow.com/questions/23106621/replace-multiple-consecutive-white-spaces-with-one-comma-in-unix
                                            	local pip_list_output
                                            	local retroscraper_remote_module
                                            	local retroscraper_remote_modules=()
                                            	retroscraper_remote_modules=(
                                            	wheel==0.40.0
                                            	setuptools==67.7.2
                                            	googletrans==4.0.0rc1
                                            	Pillow==9.5.0
                                            	requests==2.30.0
                                            	httpimport==1.3.0
                                            	)
                                            	#this command was the first test and filters out the required modules but has no speed advantage vs the used command
                                            	#pip_list_output=$(su $user -c "python3 -m pip list|sed 's/ \{1,\}/==/g'|awk \"/${retroscraper_remote_modules[0]}/ || /${retroscraper_remote_modules[1]}/ || /${retroscraper_remote_modules[2]}/ || /${retroscraper_remote_modules[3]}/ ||  /${retroscraper_remote_modules[4]}/ || /${retroscraper_remote_modules[5]}/\"")
                                            	pip_list_output=$(su $user -c "python3 -m pip list|sed 's/ \{1,\}/==/g'")
                                            	
                                            	for retroscraper_remote_module in ${retroscraper_remote_modules[@]};do 
                                            	[[ $pip_list_output != *$retroscraper_remote_module* ]] && su $user -c "python3 -m pip install --user $retroscraper_remote_module"
                                            	done
                                            }
                                            
                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              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.