Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download everything into folders per game #34

Open
sluedecke opened this issue Dec 17, 2020 · 0 comments
Open

Download everything into folders per game #34

sluedecke opened this issue Dec 17, 2020 · 0 comments

Comments

@sluedecke
Copy link

sluedecke commented Dec 17, 2020

So far wyvern down and wyvern extras both support the --output flag. But wyvern down -a does not create folders per game. wyvern extras does, so one might end up with a folder full of install files, patch files and a bunch of subdirs for extras. And still wyvern extras needs to be called per game.

I have > 50 games on gog so this is not tidy enough for me. It would be very nice for wyvern to have an option to automatically create one folder per game based on the metadata received from gog.com (e.g. game title).

Until then this script might come in handy (it mentions zsh, but should run on bash, too) (it requires: wyvern, json_pp and jq):

#!/bin/bash

GAMESDIR=SOMEPLACE/gog-games
(
    cd $GAMESDIR
    wyvern ls --json | json_pp > ALLGAMES

    for row in `jq -r '.games[].ProductInfo | {title: .title, id: .id} | @base64' ALLGAMES`
    do 
        R=`echo ${row} | base64 --decode`
        D=`echo $R | jq -r '.title'`
        I=`echo $R | jq -r '.id'`
        echo Downloading $D
        mkdir "$D"
        cd "$D"
        wyvern down -D -r -w --id $I
        wyvern extras -a --id $I
        cd -
    done

) 2>&1 | tee -a $GAMESDIR/log-`date +%Y-%m-%d`.log 

Update: redirection of stderr fixed, uses bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant