Itchio Downloader Tool with python

Overview

Itchio Downloader Tool

Install

pip install git+https://github.com/emersont1/itchio 

Download All Games in library from account

python -m itchio.downloader

This uses the same API the itchio app uses to download the files. If you have 2FA enabled, generate an API key here and run the following instead

python -m itchio.downloader --api-key=KEYHERE

Add All Games in a bundle to your library

python -m itchio.downloader

This is a bit of a bodge, but it works. It essentially goes through and clicks the "Download" link on every item on the bundle's page, which adds it to your itchio library. It does not download any files. You will need the download page's URL (this will be in the bundle's email, and possibly your purchase history). It will not work with 2FA, and I'm unlikely to be able to fix it without making it far more complicated

Comments
  • Downloader is creating folders and JSON files for about half of my library, then exiting

    Downloader is creating folders and JSON files for about half of my library, then exiting

    I have three bundles which I have added to my itch.io library, resulting in about 4,000 games in my library. When using python -m itchiodl.downloader with my API key to download my library, the following occurs:

    • The downloader says a number of "pages" are loaded
    • The downloader starts going through the list of games, saying it is downloading them
    • Publisher and game folders are created for these games on my hard drive in the CWD
    • JSON files are also created for games, within publisher folders
    • The downloader says games have been downloaded (x of 3918)
    • Nothing is actually downloaded except for the JSON files
    • Eventually the downloader simply stops, with the last item being that a game was downloaded (x of 3918)

    Sometimes it makes it to about 1,000 games "downloaded", sometimes 1,500 before it quits. It leaves no error message or error text file with any other information. It doesn't seem to matter if I change the number of jobs (I've tried 4 jobs and 8 jobs), run with administrator privileges (using Python through Windows command prompt), or anything else. I'm not utilizing a VPN or anything else special. I'm running Python 3.9 64-bit on Windows 10.

    opened by RBZL 18
  • Broken on Python 3.10

    Broken on Python 3.10

    Both scripts doesn't seem to work on Python 3.10:

    itch-download:

    Traceback (most recent call last):
      File "/home/user/.local/bin/itch-download", line 8, in <module>
        sys.exit(main())
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/downloader/__main__.py", line 21, in main
        l = itchiodl.LoginAPI(user, password)
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/login.py", line 29, in LoginAPI
        raise RuntimeError
    RuntimeError
    

    itch-load-bundle:

    Traceback (most recent call last):
      File "/home/user/.local/bin/itch-load-bundle", line 8, in <module>
        sys.exit(main())
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/bundle_tool/__main__.py", line 12, in main
        b.load_games()
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/bundle.py", line 14, in load_games
        pages = int(s.select("span.pager_label a")[-1].text)
    IndexError: list index out of range
    

    Works fine on Python 3.9

    opened by TheFrenchGhosty 16
  • Dropbox link crashes the downloader

    Dropbox link crashes the downloader

    Hey, great tool! I'm trying to download my library but it always crashes at a game that only has a dropbox link for download.

    Traceback (most recent call last): File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\site-packages\itchio\downloader_main.py", line 26, in lib.download_library() File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\site-packages\itchio\library.py", line 32, in download_library game.download(self.login) File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\site-packages\itchio\game.py", line 62, in download itchio.utils.download(url, path, self.name +" - "+file) File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\site-packages\itchio\utils.py", line 11, in download filename = re.search(r'filename="(.+)"', cd).group(1) File "C:\Users*\AppData\Local\Programs\Python\Python38\lib\re.py", line 199, in search return _compile(pattern, flags).search(string) TypeError: expected string or bytes-like object

    Since there's no way to remove games from the library, could you please add a way to ignore games with dropbox links?

    The only workaround I've found is to create a .json file with the name of the game so that the downloader skips it.

    opened by bathrobehero 10
  • Crash - AttributeError: 'NoneType' object has no attribute 'group'

    Crash - AttributeError: 'NoneType' object has no attribute 'group'

    The download script consistently crash on this file.

    Downloading Calico - Calico.Template.zip
    Traceback (most recent call last):
      File "/home/user/.local/bin/itch-download", line 8, in <module>
        sys.exit(main())
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/downloader/__main__.py", line 31, in main
        lib.download_library()
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/library.py", line 35, in download_library
        game.download(self.login)
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/game.py", line 68, in download
        itchiodl.utils.download(url, path, self.name + " - " + file)
      File "/home/user/.local/lib/python3.10/site-packages/itchiodl/utils.py", line 21, in download
        filename = re.search(r'filename="(.+)"', cd).group(1)
    AttributeError: 'NoneType' object has no attribute 'group'
    
    opened by TheFrenchGhosty 7
  • TypeError: expected string or bytes-like object

    TypeError: expected string or bytes-like object

    Downloading Troika! Numinous Edition - edit
    Traceback (most recent call last):
      File "c:\Python310\lib\runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "c:\Python310\lib\runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "c:\Python310\lib\site-packages\itchio\downloader\__main__.py", line 26, in <module>
        lib.download_library()
      File "c:\Python310\lib\site-packages\itchio\library.py", line 32, in download_library
        game.download(self.login)
      File "c:\Python310\lib\site-packages\itchio\game.py", line 62, in download
        itchio.utils.download(url, path, self.name +" - "+file)
      File "c:\Python310\lib\site-packages\itchio\utils.py", line 11, in download
        filename = re.search(r'filename="(.+)"', cd).group(1)
      File "c:\Python310\lib\re.py", line 200, in search
        return _compile(pattern, flags).search(string)
    TypeError: expected string or bytes-like object
    

    The game in question is: https://melsonian-arts-council.itch.io/troika-numinous-edition/ purchased from the Ukraine bundle.

    The type of cd is none, thus the header doesn't exist, if I understand it correctly.

    opened by RonaldH 7
  • Download free games with this tool?

    Download free games with this tool?

    Maybe add the ability to input a link to a game page, like https://etra-etra-games.itch.io/vortex-an-fps-where-you-cant-damage-enemies for example, so that you can download games that aren’t able to be added to your library.

    opened by wertercatt 6
  • Differentiate between Windows, Linux and MacOS

    Differentiate between Windows, Linux and MacOS

    Is there any way to differentiate between Windows, Linux and MacOS versions? For example if I want to download all Windows versions of all games (since I don't use Linux or MacOS)?

    Currently as I see it really downloads everything, even if I don't need Linux or MacOS.

    opened by lostprophet 6
  • Need to clean output name

    Need to clean output name

    On windows, at least.

    Too lazy to submit a PR, but this works: Utils.py:

    def download_url(url, output_path, desc):
        with DownloadProgressBar(unit='B', unit_scale=True,
                                 miniters=1, desc=desc) as t:
            output_path = re.sub(r'[\:\*\?\"\<\>\|]', ' ', output_path)
            urllib.request.urlretrieve(url, filename=output_path, reporthook=t.update_to)
    
    opened by pdughi 6
  • Adding Multithreading

    Adding Multithreading

    hey all

    I know this is gaining some traction at the moment, so I thought I'd add some multithreading to try and make it run faster / more efficiently

    I'm not going to merge this in until I've had several people test this, so I'd appreciate feedback in the comments

    Installing:

    # clone the repo
    git clone https://github.com/Emersont1/itchio
    
    # checkout to multithreading
    cd itchio
    git checkout multithreading
    
    # create and load a venv
    python -m venv venv
    source venv/bin/activate
    
    # install
    pip install .
    
    # profit?
    python -m itchiodl.downloader -k INSERT_API_KEY_HERE
    
    opened by Emersont1 5
  • Running into error while trying to add all items in a bundle to my account

    Running into error while trying to add all items in a bundle to my account

    C:\Users\Username\Desktop\ItchioGames>python -m itchiodl.bundle_tool
    Username: removed
    Password:
    Bundle URL: removed
    Traceback (most recent call last):
      File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\itchiodl\bundle_tool\__main__.py", line 17, in <module>
        main()
      File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\itchiodl\bundle_tool\__main__.py", line 13, in main
        b.load_games()
      File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\itchiodl\bundle.py", line 15, in load_games
        pages = int(s.select("span.pager_label a")[-1].text)
    IndexError: list index out of range
    

    Extra info: I am not using 2FA, just username and password

    How can I fix this?

    opened by Technerder 4
  • Added some filename fixes

    Added some filename fixes

    Hopefully this will fix the issues in #28

    Can you test it on the one it wasn't working on before with these fixes please

    # clone the repo
    git clone https://github.com/Emersont1/itchio
    
    # checkout to filename-fixes
    cd itchio
    git checkout filename-fixes
    
    # create and load a venv
    python -m venv venv
    source venv/bin/activate
    
    # install
    pip install .
    
    # profit?
    python -m itchiodl.downloader -k INSERT_API_KEY_HERE
    
    opened by Emersont1 4
  • Detect (and remove) files that aren't available on Itch servers (older version of games)

    Detect (and remove) files that aren't available on Itch servers (older version of games)

    Currently, itchiodl will download every new file as if the older one don't exist:

    • if a file with the same name exist, it will overwrite it
    • if a file with a different name exist, it will just download the new file and "ignore" the existing file

    This is a bit of a problem, in the sense that everytime a game update, you will more than likely keep the older version.

    lgogdownloader (the main GOG.com downloader) "solves" that with --check-orphan function that will check and reports (only reports, it won't do anything to them) the files that exist that aren't available to download anymore (which is, almost all the time: older versions).

    itchiodl definitely needs something like that considering how many "thing" someone can have with the bundles.

    Something that can delete those older files would be even better, but a "detector" would be a good start.

    PS: thanks (again) for itchiodl!

    opened by TheFrenchGhosty 0
  • Can't Get Downloader working

    Can't Get Downloader working

    I can't seem to get the downloader working, I got the bundle tool to add all my games to my library. When I start a download I get this window, it looks like it is downloading but no files or folders are made anywhere on my computer. I have tried Python 3.8 as I saw it was stable in a Reddit post and I have tried 3.10 as well. I even tried a different computer in case it was an issue with Windows 11. I have also tried using the API key as well. Is there something I am not doing? 2022-07-09 09_53_15-Command Prompt

    opened by Zurriel599 6
  • Verbose Folders Argument (And Others)

    Verbose Folders Argument (And Others)

    I feel like I've got these changes in a relatively clean spot for review, to summarize:

    • added the -vf argument for Verbose Folders, created folder structure uses display names for game titles and publishers
    • added the -v argument for toggling verify step functionality
    • added the -sas argument for specifying that you wish to skip downloading files above a size threshold (for disk saving)
    • various small improvements like using one call to os.makedirs() vs multiple os.mkdir() calls
    • patched an issue where download keys weren't being inherited properly by game objects as they were being appended to the library list, preventing downloads
    opened by N64Core 4
  • Add Games in bundle to library does not work

    Add Games in bundle to library does not work

    root@ca48796d249d:/# itch-load-bundle
    Username: [email protected]
    Password:
    Bundle URL: http://itch.io/bundle/download/4T80AvOSA70gkpyUhMNhaaghCbEY7J0DAJjWaWZd
    Traceback (most recent call last):
      File "/usr/local/bin/itch-load-bundle", line 8, in <module>
        sys.exit(main())
      File "/usr/local/lib/python3.10/site-packages/itchiodl/bundle_tool/__main__.py", line 13, in main
        b.load_games()
      File "/usr/local/lib/python3.10/site-packages/itchiodl/bundle.py", line 17, in load_games
        pages = int(s.select("span.pager_label a")[-1].text)
    IndexError: list index out of range
    root@ca48796d249d:/#
    

    Did I use the Program as intended, or is this actually an issue?

    opened by GhostJumper 8
Releases(v2.1.2)
  • v2.1.2(Nov 27, 2022)

  • v2.1.1(Nov 27, 2022)

  • v2.1.0(May 18, 2022)

    This adds the option to download games not already in your library

    What's Changed

    • Individual game by @Emersont1 in https://github.com/Emersont1/itchio/pull/53

    Full Changelog: https://github.com/Emersont1/itchio/compare/v2.0...v2.1.0

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(May 9, 2022)

    Version 2!

    There's a bunch of new features and should make it far easier to use

    What's Changed

    • Added some filename fixes by @Emersont1 in https://github.com/Emersont1/itchio/pull/29
    • Adding Multithreading by @Emersont1 in https://github.com/Emersont1/itchio/pull/20
    • Platform tools by @Emersont1 in https://github.com/Emersont1/itchio/pull/40
    • Added cleaned up path (#6 fix) by @Emersont1 in https://github.com/Emersont1/itchio/pull/42
    • Fixes by autopep8 action by @github-actions in https://github.com/Emersont1/itchio/pull/45
    • Fixes using md5sums by @Emersont1 in https://github.com/Emersont1/itchio/pull/46
    • Added Beautified JSON output by @Emersont1 in https://github.com/Emersont1/itchio/pull/30
    • linting by @Emersont1 in https://github.com/Emersont1/itchio/pull/51
    • Added Progress Output by @Emersont1 in https://github.com/Emersont1/itchio/pull/52
    • Version 2.0 changes by @Emersont1 in https://github.com/Emersont1/itchio/pull/35

    Full Changelog: https://github.com/Emersont1/itchio/compare/v1.2.1...v2.0

    Source code(tar.gz)
    Source code(zip)
  • v1.2.1(Mar 12, 2022)

  • v1.1.1(Mar 9, 2022)

Owner
Peter Taylor
Development Secretary @HackSocNotts,
Peter Taylor
Python-Youtube-Downloader - An Open Source Python Youtube Downloader

Python-Youtube-Downloader Hello There This Is An Open Source Python Youtube Down

Flex Tools 3 Jun 14, 2022
Youtube-downloader-using-Python - Youtube downloader using Python

Youtube-downloader-using-Python Hii guys !! Fancy to see here Welcome! built by

Lakshmi Deepak 2 Jun 9, 2022
YouTube-Downloader - YouTube Video Downloader made using python

YouTube-Downloader YouTube Videos Downloder made using python.

Shivam 1 Jan 16, 2022
Youtube Downloader is a simple but highly efficient Youtube Video Downloader, made completly using Python

Youtube Downloader is a simple but highly efficient Youtube Video Downloader, made completly using Python

Arsh 2 Nov 26, 2022
MMDL (Mega Music Downloader) - A tool to easily download music.

mmdl - Mega Music Downloader What is mmdl ❓ TLDR: MMDL is a cli app which allows you to quickly and efficiently download one or multiple songs from Yo

techboy-coder 30 Dec 13, 2022
YT-Downloader is a Tool to download youtube video.

YT-Downloader YT-Downloader is a Tool to download youtube video.If you are looking for a simple video downloader tool Than This YT-Downloader may be u

Pradip Thapa 7 May 11, 2022
Vinetrimmer-DRM-TOOL - Widevine DRM downloader and decrypter for AMZN|NF|STAN And all

?? ✂️ Vinetrimmer Widevine DRM downloader and decrypter. Thanks to wvleaks for t

Vlad Tănăsescu 20 Jan 13, 2022
music downloader written in python. (Uses jiosaavn API)

music downloader written in python. (Uses jiosaavn API)

Rohn Chatterjee 35 Jul 20, 2022
bing image downloader app used to download bulk images for a specific search term created using streamlit and bing_image_downloader python packages

bing image downloader app bing image downloader app is used to download bulk images for a specific search term. bing image downloader app gets the sea

Siva Prakash 8 Apr 5, 2022
Youtube Video Downloader Using Python Gui Appliction with progress Bar

Youtube-Video-Downloader Youtube Video Downloader Using Python Gui Appliction with progress Bar Module Used Pytube Tkinter Pil Urllib Bytes Io LICENSE

Community Programmer 6 Dec 19, 2022
Ebook downloader built using python

ebook-downloader Getting Started Open a terminal and run the following commands. git clone github.com/georgemunyoro/ebook-downloader cd ./ebook-downlo

George Munyoro 1 Oct 19, 2021
This is Yt Downloader. Coded with Python (my first repository)

Get Started Download & install Python first before using this software. Download Python Installing Python and Pytube Library (IMPORTANT) Installing Py

Qi 2 Oct 25, 2021
A simple kemono.party downloader using python.

kemono-dl This is a simple kemono.party downloader. How to use Install python Download source code from releases and extract it Then install requireme

null 318 Dec 27, 2022
Python Youtube Video-Playlist Downloader

Youtube-Video-Playlist-Downloader-PyQt5 You can download videos and playlists on YouTube with this script. Script has GUI. Enjoy. Setup git clone http

Yunus Emre Öztürk 2 Jun 6, 2022
Spotify Playlist Downloader With Python

Spotify Playlist Downloader This will let you download Spotify playlists for free without Premium. It gets all the songs from the API and downloads th

Yasho 16 Sep 28, 2022
A simple GUI video downloader built off of the python module 'yt-dlp'

Simple-Youtube-DL-Gui Supported Operating Systems Windows 7 (x64), Windows 8 (x64), and Windows 10 (x64) How to use Main Gui Extract program from arch

null 12 Dec 30, 2022
Web Downloader With Python

Web Downloader Introduction This module will provide API to download the webpage components : html file, image file, css fil, javascript file, href li

null 3 Dec 28, 2022
Youtube Downloader by PyTube é uma ferramenta simples com interface gráfica e escrito em python para baixar vídeos e playlists do youtube...

YouTube Downloader by PyTube O que é o YouTube Downloader by PyTube? YouTube Downloader by PyTube é um software simples para baixar vídeos no YouTube

Elizeu Barbosa Abreu 5 Jul 30, 2022