Skip to main content

Scrape Linux Distro torrents and add to Transmission automatically

Project description

distroscraper

Scrapes Linux distribution web pages for new torrent files and adds them to Transmission. I want to give back to the Free Software community and one way I can do that is by seeding their torrents.

For legitimate redistrbution of permitted content only.

Included are scrapers for these distributions:

  • Arch Linux
  • Debian
  • Fedora
  • Linux Mint
  • Raspberry Pi

Would love to include, if they would provide a legitimate torrent:

  • OPNsense

If your favorite distribution is not mentioned, you can open an issue, or contribute a pull request. Take a look at the other files in /distroscraper/scrape and make it look like those in general.

Installation

Create and configura a Python Virtual Environment for distroscraper:

python -m venv /home/myser/.venv_distroscraper
. /home/myuser/.venv_distroscraper/bin/activate
pip install distroscraper

Use scrape-and-add.sh.dist from this repository or from this README file to create your own scrape-and-add.sh. You will also need the 'jq' command line json processing tool.

#!/bin/bash

VENV_PATH=/path/to/venv
DISTROS="distroscraper.scrape.archlinux
         distroscraper.scrape.debian
         distroscraper.scrape.fedora
         distroscraper.scrape.linuxmint
         distroscraper.scrape.raspberrypi"
TM_ARGS="--host localhost
         --port 9091
         --user myuser
         --password supersecret
         --download-dir /path/to/linuxdownloads"

for d in $DISTROS; do
  $VENV_PATH/bin/python -m $d | \
    jq .href | \
    xargs $VENV_PATH/bin/python -m distroscraper.tm_add_torrent $TM_ARGS

Create a systemd timer or cron job to run scrape-and-add.sh periodically. Transmission is smart enough not to add the same torrent multiple times.

Reporting

If you want to ingest transmissions stats into some logging solution like ELK or Graylog, you can use this which will produce some JSON that can be massaged into these systems:

python -m distroscraper.tm_get_stats

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

distroscraper-1.0.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

distroscraper-1.0.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file distroscraper-1.0.0.tar.gz.

File metadata

  • Download URL: distroscraper-1.0.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for distroscraper-1.0.0.tar.gz
Algorithm Hash digest
SHA256 560597993ff3e72b8e924a349a54275c62d058d720705f0582f6c3733e5fe38e
MD5 dbde5bc6baeabd4567a3beefe5831074
BLAKE2b-256 e1fb9b05d2d6864978bd6a3535501b24fe31651cfb7b295afe2bb635043a6bd2

See more details on using hashes here.

File details

Details for the file distroscraper-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: distroscraper-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5

File hashes

Hashes for distroscraper-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 118b33ab109be8d79ef0b803083b825e4f84c1bbf308974ccb292a9f0470aee0
MD5 382039ffcd2e4b0fe1c642bca5c5c799
BLAKE2b-256 e48d5d478c4aaadf7426bce7a4df484d3ec7f7b29671f9e0249017ca1279b2fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page