🌱 Complete API wrapper of Seedr.cc

Overview

seedrpy logo

Python API Wrapper of Seedr.cc

Stars Issues

Table of Contents

Installation

  • Install via PyPi

    pip install seedrcc
  • Install from the source

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

How I got the API endpoints

Seedr don't provide an API to the freemium users. However, Seedr has a chrome and kodi extension that works for all users. Some of the endpoints (very few) are extracted from these extensions.

After analyzing the requests sent by the seedr site (old version), I found the seedr-site API (which needs captcha) are quiet similar to that of seedr-chrome and seedr-kode API. So, I just predicted the other endpoints.

This API works for all users since it uses the seedr-chrome and seedr-kodi API.

Start guide


Getting Token

There are two methods to get the account token. You can login with username/password or by authorizing with device code (Recommended).

Logging with Username and Password

This method uses the seedr Chrome extension API. The token generated by this method expires after 12 hours. You need to refresh the token after it expires.

from seedrcc import Login

seedr = Login('[email protected]', 'password')

response = seedr.authorize()
print(response)

# Getting the token 
print(seedr.token)

Authorizing with device code

This method uses the seedr kodi API. The token generated by this method expires after 1 year.

To use this method, generate a device & user code. Paste the user code in https://seedr.cc/devices and authorize with the device code.

from seedrcc import Login

seedr = Login()

deviceCode = seedr.getDeviceCode()
# Go to https://seedr.cc/devices and paste the user code
print(deviceCode)

# Authorize with device code
response = seedr.authorize(deviceCode['device_code'])
print(response)

# Getting the token
seedr.token

Basic Examples

For all available methods, please refer to the documentation.

from seedrcc import Seedr

account = Seedr(token='token')

# Getting user settings
print(account.getSettings())

# Adding torrent
response = account.addTorrent('magnetlink')
print(response)

#Listing folder contents
response = account.listContents()
print(response)

Managing token

The token generated by using the username/password method expires after short period of time. So, you need to refresh the token after the token expires. You can refresh the token manually or automatically.

Refreshing the token manually

You can manually refresh the token by using the refreshToken method. After calling the refreshToken method, you should store the refreshed token for your future use.

account = Seedr(token='token')
account.getSettings() # Error: Token expired

# Manually refreshing the token
account.refreshToken()

# Getting the new token
print(account.token)
 
# Calling the getSettings method again after refreshing the token
account.getSettings()

Refreshing the token automatically

Refreshing the token manualy can be a cumbersome task. So, you can use the auto refresh function to refresh the token automatically after it expires.

account = Seedr(token='token', autoRefresh=True)

# Token will be refreshed automatically
account.getSettings()

Callback function

You can also set a callback function which will be called automatically each time the token is refreshed. You can use such function to deal with the refreshed token.

✏️ Note: The callback function must have at least one parameter. The first parameter of the callback function will be the updated token.

Callback function with single argument

Here is an example of callback function with a single argument which updates the token in a file called token.txt.

# Read the token from token.txt
token = open('token.txt', 'r').read().strip()

# Defining the callback function
def afterRefresh(token):
    with open('token.txt', 'w') as f:
        f.write(token)

account = Seedr(token, autoRefresh=True, callbackFunc=afterRefresh)

Callback function with multiple arguments

In situations where you need to pass multiple arguments to the callback function, you can use the lambda function. Callback function with multiple arguments can be useful if your app is dealing with multiple users.

Here is an example of callback function with multiple arguments which will update the token of certain user in the database after the token of that user is refreshed.

# Defining the callback function
def afterRefresh(token, userId):
    # Add your code to deal with the database
    print(f'Token of the user {userId} is updated.')

# Creating a Seedr object for user 12345
account = Seedr(token='token', autoRefresh=True, callbackFunc=lambda token: afterRefresh(token, userId='12345'))

Documentation

The detailled documentation of each methods is available here.

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

You might also like...
A simple tutorial to get you started with Discord and it's Python API
A simple tutorial to get you started with Discord and it's Python API

Hello there Feel free to fork and star, open issues if there are typos or you have a doubt. I decided to make this post because as a newbie I never fo

A swagger tool for tornado, using python to write api doc!
A swagger tool for tornado, using python to write api doc!

SwaggerDoc About A swagger tool for tornado, using python to write api doc! Installation pip install swagger-doc Quick Start code import tornado.ioloo

A set of Python libraries that assist in calling the SoftLayer API.

SoftLayer API Python Client This library provides a simple Python client to interact with SoftLayer's XML-RPC API. A command-line interface is also in

Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized
Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized

Data-Scrapping SEO - the project uses various data scrapping and Google autocompletes API tools to provide relevant points of different keywords so that search engines can be optimized; as this information is gathered, the marketing team can target the top keywords to get your company’s website higher on a results page.

A simple document management REST based API for collaboratively interacting with documents

documan_api A simple document management REST based API for collaboratively interacting with documents.

Unofficial API wrapper for seedr.cc

Seedr API Unofficial API wrapper for seedr.cc Inspired by theabbie's seedr-api Powered by @harp_tech (Telegram) How to use You can install lib via git

API Wrapper for seedr.cc
API Wrapper for seedr.cc

Seedr Python Client Seedr API built with 💛 by Souvik Pratiher Hit that Star button if you like this kind of SDKs and wants more of similar SDKs for o

🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase 📌 Links |Join the discord

rewise is an unofficial wrapper for google search's auto-complete feature

rewise is an unofficial wrapper for google search's auto-complete feature

Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

A delightful and complete interface to GitHub's amazing API

ghapi A delightful and complete interface to GitHub's amazing API ghapi provides 100% always-updated coverage of the entire GitHub API. Because we aut

Complete Fundamental to Expert Codes of FastAPI for creating API's
Complete Fundamental to Expert Codes of FastAPI for creating API's

FastAPI FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3 based on standard Python type hints. The key featu

A RESTful API for creating and monitoring resource components of a hypothetical build system. Built with FastAPI and pydantic. Complete with testing and CI.
A RESTful API for creating and monitoring resource components of a hypothetical build system. Built with FastAPI and pydantic. Complete with testing and CI.

diskspace-monitor-CRUD Background The build system is part of a large environment with a multitude of different components. Many of the components hav

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

Python API wrapper around Trello's API

A wrapper around the Trello API written in Python. Each Trello object is represented by a corresponding Python object. The attributes of these objects

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.

PRAW: The Python Reddit API Wrapper PRAW, an acronym for "Python Reddit API Wrapper", is a Python package that allows for simple access to Reddit's AP

An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% api coverage most of the codebase is documented

Async ready API wrapper for Revolt API written in Python.

Mutiny Async ready API wrapper for Revolt API written in Python. Installation Python 3.9 or higher is required To install the library, you can just ru

An API Wrapper for Gofile API

Gofile2 from gofile2 import Gofile g_a = Gofile() print(g_a.upload(file="/home/itz-fork/photo.png")) An API Wrapper for Gofile API. About API Gofile

Comments
  • Cant download folders as a zip

    Cant download folders as a zip

    Thank you for this awesome tool. I tried to download folders as zip using createArchive function but can't download folders as a zip with the returning URL..

    opened by TharukaMannapperuma 0
Releases(v1.0.1)
  • v1.0.1(May 30, 2022)

  • v1.0.0(May 26, 2022)

    • Allow to add torrent with a wishlistId
    • Add deleteWishlist method to delete a wishlist
    • Remove autoRefresh attribute and set it to True
    • Fix error if Seedr responds with a plain text instead of JSON

    Full Changelog: https://github.com/hemantapkh/seedrcc/compare/v0.0.1...v1.0.0

    Source code(tar.gz)
    Source code(zip)
Owner
Hemanta Pokharel
Programmer | YouTuber | CS Undergrad
Hemanta Pokharel
Create docsets for Dash.app-compatible API browser.

doc2dash: Create Docsets for Dash.app and Clones doc2dash is an MIT-licensed extensible Documentation Set generator intended to be used with the Dash.

Hynek Schlawack 498 Dec 30, 2022
Grokking the Object Oriented Design Interview

Grokking the Object Oriented Design Interview

Tusamma Sal Sabil 2.6k Jan 08, 2023
🍭 epub generator for lightnovel.us 轻之国度 epub 生成器

lightnovel_epub 本工具用于基于轻之国度网页生成epub小说。 注意:本工具仅作学习交流使用,作者不对内容和使用情况付任何责任! 原理 直接抓取 HTML,然后将其中的图片下载至本地,随后打包成 EPUB。

gyro永不抽风 188 Dec 30, 2022
MkDocs Plugin allowing your visitors to *File > Print > Save as PDF* the entire site.

mkdocs-print-site-plugin MkDocs plugin that adds a page to your site combining all pages, allowing your site visitors to File Print Save as PDF th

Tim Vink 67 Jan 04, 2023
Types that make coding in Python quick and safe.

Type[T] Types that make coding in Python quick and safe. Type[T] works best with Python 3.6 or later. Prior to 3.6, object types must use comment type

Contains 17 Aug 01, 2022
A Python package develop for transportation spatio-temporal big data processing, analysis and visualization.

English 中文版 TransBigData Introduction TransBigData is a Python package developed for transportation spatio-temporal big data processing, analysis and

Qing Yu 251 Jan 03, 2023
Collections of Beautiful Latex Snippets

HandyLatex Collections of Beautiful Latex Snippets Table 👉 Succinct table with bold separation line and gray text %################## Dependencies ##

Xintao 15 Apr 11, 2022
NoVmpy - NoVmpy with python

git clone -b dev-1 https://github.com/wallds/VTIL-Python.git cd VTIL-Python py s

263 Dec 23, 2022
Data science on SDGs - Udemy Online Course Material: Data Science on Sustainable Development Goals

Data Science on Sustainable Development Goals (SDGs) Udemy Online Course Material: Data Science on Sustainable Development Goals https://bit.ly/data_s

Frank Kienle 1 Jan 04, 2022
Automated Integration Testing and Live Documentation for your API

Automated Integration Testing and Live Documentation for your API

ScanAPI 1.3k Dec 30, 2022
Contains the assignments from the course Building a Modern Computer from First Principles: From Nand to Tetris.

Contains the assignments from the course Building a Modern Computer from First Principles: From Nand to Tetris.

Matheus Rodrigues 1 Jan 20, 2022
The purpose of this project is to share knowledge on how awesome Streamlit is and can be

Awesome Streamlit The fastest way to build Awesome Tools and Apps! Powered by Python! The purpose of this project is to share knowledge on how Awesome

Marc Skov Madsen 1.5k Jan 07, 2023
Beautiful static documentation generator for OpenAPI/Swagger 2.0

Spectacle The gentleman at REST Spectacle generates beautiful static HTML5 documentation from OpenAPI/Swagger 2.0 API specifications. The goal of Spec

Sourcey 1.3k Dec 13, 2022
A simple document management REST based API for collaboratively interacting with documents

documan_api A simple document management REST based API for collaboratively interacting with documents.

Shahid Yousuf 1 Jan 22, 2022
[Unofficial] Python PEP in EPUB format

PEPs in EPUB format This is a unofficial repository where I stock all valid PEPs in the EPUB format. Repository Cloning git clone --recursive Mickaël Schoentgen 9 Oct 12, 2022

A module filled with many useful functions and modules in various subjects.

Usefulpy Check out the Usefulpy site Usefulpy site is not always up to date Download and Import download and install with with pip download usefulpyth

Austin Garcia 1 Dec 28, 2021
Canonical source repository for PyYAML

PyYAML - The next generation YAML parser and emitter for Python. To install, type 'python setup.py install'. By default, the setup.py script checks

The YAML Project 2k Jan 01, 2023
epub2sphinx is a tool to convert epub files to ReST for Sphinx

epub2sphinx epub2sphinx is a tool to convert epub files to ReST for Sphinx. It uses Pandoc for converting HTML data inside epub files into ReST. It cr

Nihaal 8 Dec 15, 2022
advance python series: Data Classes, OOPs, python

Working With Pydantic - Built-in Data Process ========================== Normal way to process data (reading json file): the normal princiople, it's f

Phung Hưng Binh 1 Nov 08, 2021
DataAnalysis: Some data analysis projects in charles_pikachu

DataAnalysis DataAnalysis: Some data analysis projects in charles_pikachu You can star this repository to keep track of the project if it's helpful fo

9 Nov 04, 2022