All Projects → hemantapkh → 1337x

hemantapkh / 1337x

Licence: MIT license
✖️ Unofficial API of 1337x.to

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to 1337x

cl-torrents
Searching torrents on popular trackers - CLI, readline, GUI, web client. Tutorial and binaries (issue tracker on https://gitlab.com/vindarel/cl-torrents/)
Stars: ✭ 83 (+6.41%)
Mutual labels:  torrents, 1337x
IMDb-Scout-Mod
Auto search for movie/series on torrent, usenet, ddl, subtitles, streaming, predb and other sites. Adds links to IMDb pages from hundreds various sites. Adds movies/series to Radarr/Sonarr. Adds external ratings from Metacritic, Rotten Tomatoes, Letterboxd, Douban, Allocine. Media Server indicators for Plex, Jellyfin, Emby. Dark theme/style for …
Stars: ✭ 177 (+126.92%)
Mutual labels:  torrents, 1337x
Diffy
🎞️💓🍿 Love streaming - It's always best to watch a movie together ! 🤗
Stars: ✭ 37 (-52.56%)
Mutual labels:  torrents
Watcher
Stars: ✭ 137 (+75.64%)
Mutual labels:  torrents
Fbiwarning
Node.js seed downloader (Node.js 种子神器)
Stars: ✭ 44 (-43.59%)
Mutual labels:  torrents
deflix-stremio
Deflix addon for Stremio
Stars: ✭ 31 (-60.26%)
Mutual labels:  torrents
Deluge Webapi
Plugin for Deluge WebUI providing sane JSON API
Stars: ✭ 90 (+15.38%)
Mutual labels:  torrents
Torrents-to-Google-Drive
This is a Google Colab notebook with QBittorrent and Rclone, which can download torrents to Google Drive
Stars: ✭ 56 (-28.21%)
Mutual labels:  torrents
Gazelle
Stars: ✭ 186 (+138.46%)
Mutual labels:  torrents
Transmissionrpc
Golang bindings for Transmission RPC API
Stars: ✭ 35 (-55.13%)
Mutual labels:  torrents
Cloudbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 1,763 (+2160.26%)
Mutual labels:  torrents
Filemasta
A search application to explore, discover and share online files
Stars: ✭ 571 (+632.05%)
Mutual labels:  torrents
Monitorrent
Automatic torrents downloader
Stars: ✭ 383 (+391.03%)
Mutual labels:  torrents
Openseedbox
OpenSeedbox - Open Source Multi-User Bittorrent Web UI
Stars: ✭ 101 (+29.49%)
Mutual labels:  torrents
thepiratebay
This is unofficial API of thepiratebay.org
Stars: ✭ 62 (-20.51%)
Mutual labels:  torrents
Sickchill
Less rage, more chill.
Stars: ✭ 2,166 (+2676.92%)
Mutual labels:  torrents
arch-deluge
Docker build script for Arch Linux base with Deluge
Stars: ✭ 12 (-84.62%)
Mutual labels:  torrents
Butter Desktop
All the free parts of Popcorn Time
Stars: ✭ 4,329 (+5450%)
Mutual labels:  torrents
Bashflix
Streaming of Movies and Series on Mac and Linux
Stars: ✭ 88 (+12.82%)
Mutual labels:  torrents
Qbittorrent Controller
qBittorrent Controller - An Android app for controlling qBittorrent servers
Stars: ✭ 205 (+162.82%)
Mutual labels:  torrents

✖️Unofficial Python API Wrapper of 1337x

1337x

Stars Issues

This is the unofficial API of 1337x. It supports all proxies of 1337x and almost all functions of 1337x. You can search, get trending, top and popular torrents. Furthermore, you can browse torrents of a certain category. It also supports filtering on result by category, supports sorting and caching.

Table of Contents

Installation

  • Install via PyPi

    pip install 1337x
  • Install from the source

    git clone https://github.com/hemantapkh/1337x && cd 1337x && python setup.py sdist && pip install dist/*

Start guide

Quick Examples

1. Searching torrents

>>> from py1337x import py1337x

# Using 1337x.tw and saving the cache in sqlite database which expires after 500 seconds
>>> torrents = py1337x(proxy='1337x.to', cache='py1337xCache', cacheTime=500)

>>> torrents.search('harry potter')
{'items': [...], 'currentPage': 1, 'itemCount': 20, 'pageCount': 50}

# Searching harry potter in category movies and sort by seeders in descending order
>>> torrents.search('harry potter', category='movies', sortBy='seeders', order='desc') 
{'items': [...], 'currentPage': 1, 'itemCount': 40, 'pageCount': 50}

# Viewing the 5th page of the result
>>> torrents.search('harry potter', page=5) 
{'items': [...], 'currentPage': , 'itemCount': 20, 'pageCount': 50}

2. Getting Trending Torrents

>>> from py1337x import py1337x

# Using the default proxy (1337x.to) Without using cache
>>> torrents = py1337x() 

# Today's trending torrents of all category
>>> torrents.trending() 
{'items': [...], 'currentPage': 1, 'itemCount': 50, 'pageCount': 1}

# Trending torrents this week of all category
>>> torrents.trending(week=True) 
{'items': [...], 'currentPage': 1, 'itemCount': 50, 'pageCount': 1}

# Todays trending anime 
>>> torrents.trending(category='anime') 
{'items': [...], 'currentPage': 1, 'itemCount': 50, 'pageCount': 1}

# Trending anime this week
>>> torrents.trending(category='anime', week=True) 
{'items': [...], 'currentPage': 1, 'itemCount': 50, 'pageCount': 1}

3. Getting information of a torrent

>>> from py1337x import py1337x

# Using 11337x.st and passing the cookie since 11337x.st is cloudflare protected
>>> torrents = py1337x('11337x.st', cookie='<cookie>')

# Getting the information of a torrent by its link
>>> torrents.info(link='https://www.1337xx.to/torrent/258188/h9/') 
{'name': 'Harry Potter and the Half-Blood Prince', 'shortName': 'Harry Potter', 'description': "....", 'category': 'Movies', 'type': 'HD', 'genre': ['Adventure', 'Fantasy', 'Family'], 'language': 'English', 'size': '3.0 GB', 'thumbnail': '...', 'images': [...], 'uploader': ' ...', 'uploaderLink': '...', 'downloads': '5310', 'lastChecked': '44 seconds ago', 'uploadDate': '4 years ago', 'seeders': '36', 'leechers': '3', 'magnetLink': '...', 'infoHash': '...'}

# Getting the information of a torrent by its link
>>> torrents.info(torrentId='258188') 
{'name': 'Harry Potter and the Half-Blood Prince', 'shortName': 'Harry Potter', 'description': "....", 'category': 'Movies', 'type': 'HD', 'genre': ['Adventure', 'Fantasy', 'Family'], 'language': 'English', 'size': '3.0 GB', 'thumbnail': '...', 'images': [...], 'uploader': ' ...', 'uploaderLink': '...', 'downloads': '5310', 'lastChecked': '44 seconds ago', 'uploadDate': '4 years ago', 'seeders': '36', 'leechers': '3', 'magnetLink': '...', 'infoHash': '...'}

Detailed documentation

Available attributes

from py1337x import py1337x

torrents = py1337x(proxy='1337x.st', cookie='<cookie>', cache='py1337xCache', cacheTime=86400, backend='sqlite')

Proxy

If the default domain is banned in your country, you can use an alternative domain of 1337x.

cookie

Some of the proxies are protected with Cloudflare. For such proxies you need to pass a cookie value. To get a cookie go the the protected site from your browser, solve the captcha and copy the value of cf_clearance.

Firefox: Inspect element > Storage > Cookies
Chrome: Inspect element > Application > Storage > Cookies

cache

Py1337x uses requests-cache for caching to store data so that future requests for that data can be served faster. cache can be any of the following.

  • A boolean value: True for using cache and False for not using cache. (cache is not used by default)
  • Directory for storing the cache.

cacheTime

By default the cache expires after one day. You can change the cache expiration time by setting a custom cacheTime.

  • -1 (to never expire)

  • 0 (to “expire immediately,” e.g. bypass the cache)

  • A positive number (in seconds [defaults to 86400])

  • A timedelta

  • A datetime

backend

The backend for storing the cache can be any of the following.

  • 'sqlite': SQLite database (default)

  • 'redis': Redis cache (requires redis)

  • 'mongodb': MongoDB database (requires pymongo)

  • 'gridfs': GridFS collections on a MongoDB database (requires pymongo)

  • 'dynamodb': Amazon DynamoDB database (requires boto3)

  • 'memory': A non-persistent cache that just stores responses in memory

Available methods

from py1337x import py1337x

torrents = py1337x()
Method Description Arguments
torrents.search(query) Search for torrents self,
query: Keyword to search for,
page (Defaults to 1): Page to view,
category (optional): category,
sortBy (optional): Sort by,
Order (optional): order
torrents.trending() Get trending torrents self,
category (optional): category,
week (Defaults to False): True for weekely, False for daily
torrents.top() Get top torrents self,
category (optional): category
torrents.popular(category) Get popular torrents self,
category: category,
week (Defaults to False): True for weekely, False for daily
torrents.browse(category) Browse browse of certain category self,
category: category,
page (Defaults to 1): Page to view
torrents.info(link or torrentId) Get information of a torrent self,
link: Link of a torrent or
torrentId: ID of a torrent

Available categories

  • 'movies'
  • 'tv'
  • 'games'
  • 'music'
  • 'apps'
  • 'anime'
  • 'documentaries'
  • 'xxx'
  • 'others'

Available sorting methods

  • 'time'
  • 'size'
  • 'seeders'
  • 'leechers'

Available sorting order

  • 'desc' (for descending order)
  • 'asc' (for ascending order)

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Thanks to every contributors who have contributed in this project.

Projects using this API

Want to list your project here? Just make a pull request.

License

Distributed under the MIT License. See LICENSE for more information.


Author/Maintainer: Hemanta Pokharel | Youtube: @H9Youtube

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].