It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
low rated
avatar
Magmarock: Hey, I wanted to talk to you more about this line here.

lgogdownloader --download --game '^(tyrian_2000|beneath_a_steel_sky|the_witcher)$'

Is there a more vertical way of writing that down?
avatar
Sude: Use backslash to escape the newline and split the string to multiple lines

lgogdownloader --download --game \
'^('\
'tyrian_2000'\
'|beneath_a_steel_sky'\
'|the_witcher'\
')$'
It didn't work when I tried it. Perhaps I did something wrong?
https://www.dropbox.com/s/m5h9f8zs0wcm29c/Download_Faves-2.sh?dl=0
avatar
Magmarock: It didn't work when I tried it. Perhaps I did something wrong?
https://www.dropbox.com/s/m5h9f8zs0wcm29c/Download_Faves-2.sh?dl=0
That is missing the pipe '|' separating the games
Here's a fixed script: https://pastebin.com/raw/Mirnvveu
low rated
avatar
Magmarock: It didn't work when I tried it. Perhaps I did something wrong?
https://www.dropbox.com/s/m5h9f8zs0wcm29c/Download_Faves-2.sh?dl=0
avatar
Sude: That is missing the pipe '|' separating the games
Here's a fixed script: https://pastebin.com/raw/Mirnvveu
I knew it was something like that lol.
Will this work faster than doing it this way? https://www.dropbox.com/s/ahmk3vjj29hqjuk/Download_Faves.sh?dl=0
Post edited October 27, 2021 by Magmarock
low rated
avatar
Magmarock: It didn't work when I tried it. Perhaps I did something wrong?
https://www.dropbox.com/s/m5h9f8zs0wcm29c/Download_Faves-2.sh?dl=0
avatar
Sude: That is missing the pipe '|' separating the games
Here's a fixed script: https://pastebin.com/raw/Mirnvveu
So I ran a test and this method was much faster. Take a look at the difference.

Is there an easy way to apply the pipe and slashes to all games? Aside from just typing it in?
Attachments:
game.png (32 Kb)
game_2.png (35 Kb)
avatar
Magmarock: So I ran a test and this method was much faster. Take a look at the difference.

Is there an easy way to apply the pipe and slashes to all games? Aside from just typing it in?
You can use sed to replace text

wget https://www.dropbox.com/s/m5h9f8zs0wcm29c/Download_Faves-2.sh
sed -e "/^'[0-9a-z]/s/'/'|/" -e "/[0-9a-z]'$/s/'$/'\\\/" -i Download_Faves-2.sh

/^'[0-9a-z]/ match anything that begins with ' and is followed by 0-9 or a-z
s/'/'|/ replace the first match of ' with '|

/[0-9a-z]'$/ match anything that ends with ' and is preceded by 0-9 or a-z
s/'$/'\\\/ replace ' at the end with '\

use "-i" to edit file in-place instead of printing to stdout
low rated
avatar
Magmarock: So I ran a test and this method was much faster. Take a look at the difference.

Is there an easy way to apply the pipe and slashes to all games? Aside from just typing it in?
avatar
Sude: You can use sed to replace text

wget https://www.dropbox.com/s/m5h9f8zs0wcm29c/Download_Faves-2.sh
sed -e "/^'[0-9a-z]/s/'/'|/" -e "/[0-9a-z]'$/s/'$/'\\\/" -i Download_Faves-2.sh

/^'[0-9a-z]/ match anything that begins with ' and is followed by 0-9 or a-z
s/'/'|/ replace the first match of ' with '|

/[0-9a-z]'$/ match anything that ends with ' and is preceded by 0-9 or a-z
s/'$/'\\\/ replace ' at the end with '\

use "-i" to edit file in-place instead of printing to stdout
Thanks but how do you make that work with a straight up lists like this https://www.dropbox.com/s/iiu031u0pvsu6fy/list.txt?dl=0
avatar
Magmarock: Thanks but how do you make that work with a straight up lists like this https://www.dropbox.com/s/iiu031u0pvsu6fy/list.txt?dl=0
sed -e "s/.*/'|&'\\\/" -i list.txt

or if you need to add all the other stuff in there also then
sed -e "s/.*/'|&'\\\/" -e "1i lgogdownloader --download --platform=w --exclude patches --directory '/mnt/Video/Games' --game \\\\\n'^('\\\\" -e "\$a ')$'" -i list.txt
Post edited October 29, 2021 by Sude
low rated
avatar
Magmarock: Thanks but how do you make that work with a straight up lists like this https://www.dropbox.com/s/iiu031u0pvsu6fy/list.txt?dl=0
avatar
Sude: sed -e "s/.*/'|&'\\\/" -i list.txt

or if you need to add all the other stuff in there also then
sed -e "s/.*/'|&'\\\/" -e "1i lgogdownloader --download --platform=w --exclude patches --directory '/mnt/Video/Games' --game \\\\\n'^('\\\\" -e "\$a ')$'" -i list.txt
that adds a pipe to the fist game.
avatar
Magmarock: that adds a pipe to the fist game.
It doesn't really matter since it makes the regex try to match empty string which doesn't exist

However you can just remove the pipe from the first line with "1 s/|//" after adding it to every line
sed -e "s/.*/'|&'\\\/" -e "1 s/|//" -i list.txt
or
sed -e "s/.*/'|&'\\\/" -e "1 s/|//" -e "1i lgogdownloader --download --platform=w --exclude patches --directory '/mnt/Video/Games' --game \\\\\n'^('\\\\" -e "\$a ')$'" -i list.txt
low rated
avatar
Magmarock: that adds a pipe to the fist game.
avatar
Sude: It doesn't really matter since it makes the regex try to match empty string which doesn't exist

However you can just remove the pipe from the first line with "1 s/|//" after adding it to every line
sed -e "s/.*/'|&'\\\/" -e "1 s/|//" -i list.txt
or
sed -e "s/.*/'|&'\\\/" -e "1 s/|//" -e "1i lgogdownloader --download --platform=w --exclude patches --directory '/mnt/Video/Games' --game \\\\\n'^('\\\\" -e "\$a ')$'" -i list.txt
This sed command is amazing. I still don't quite understand the contact, but if I manage to learn it I could use it for other scripts as well.
Thanks for this amazing tool and for maintaining it for so long.

Out of curiosity: Did you ever sudo rm -rf / ? :P
high rated
avatar
Magmarock: This is beautiful, this is worth installing Linux to use. I'm really impressed with it. The way it auto organizes everything. One feature I would like to see is that ability to download by tag I have a favorites tag if I could download everything with just that tag, that would be awesome.
695916a Add support for tags

Adds basic support for filtering games using tags that the user can set on account page
Add option --list-tags to list all the tags user has assigned
Add option --tag to filter games using the tags


avatar
.Keys: Thanks for this amazing tool and for maintaining it for so long.

Out of curiosity: Did you ever sudo rm -rf / ? :P
Not rm -rf / which is protected by --no-preserve-root but I accidentally did the worse option rm -rf /* which bypasses that protection.
I meant to do something like rm -rf /path/to/delete/* but instead I had accidental space in there so I did rm -rf /path/to/delete /*
After that it was time to spend a day restoring everything from backups instead of doing anything useful.
Thanks for the help, I was looking for this information
low rated
avatar
Magmarock: This is beautiful, this is worth installing Linux to use. I'm really impressed with it. The way it auto organizes everything. One feature I would like to see is that ability to download by tag I have a favorites tag if I could download everything with just that tag, that would be awesome.
avatar
Sude: 695916a Add support for tags

Adds basic support for filtering games using tags that the user can set on account page
Add option --list-tags to list all the tags user has assigned
Add option --tag to filter games using the tags
Oh dude, I'll have to check that out! This just keeps getting better and better.

With the tag option there will be no need to use the sed command; because that still confuses the hell out of me lol.

I would also like to ask you if there is a portable way of comping the program.This is the first program I can do compile from source. All I did was follow your instructions and they worked but I'm not 100% clear on what it is I actually did.
Post edited November 09, 2021 by Magmarock
avatar
.Keys: Thanks for this amazing tool and for maintaining it for so long.

Out of curiosity: Did you ever sudo rm -rf / ? :P
avatar
Sude: Not rm -rf / which is protected by --no-preserve-root but I accidentally did the worse option rm -rf /* which bypasses that protection.
I meant to do something like rm -rf /path/to/delete/* but instead I had accidental space in there so I did rm -rf /path/to/delete /*
After that it was time to spend a day restoring everything from backups instead of doing anything useful.
This is scary.