🌱 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
This program has been coded to allow the user to rename all the files in the entered folder.

Bulk_File_Renamer This program has been coded to allow the user to rename all the files in the entered folder. The only required package is "termcolor

1 Jan 06, 2022
Autolookup GUI Plugin for Plover

Word Tray for Plover Word Tray is a GUI plugin that automatically looks up efficient outlines for words that start with the current input, much like a

Kathy 3 Jun 08, 2022
Members: Thomas Longuevergne Program: Network Security Course: 1DV501 Date of submission: 2021-11-02

Mini-project report Members: Thomas Longuevergne Program: Network Security Course: 1DV501 Date of submission: 2021-11-02 Introduction This project was

1 Nov 08, 2021
A Python library that simplifies the extraction of datasets from XML content.

xmldataset: simple xml parsing 🗃️ XML Dataset: simple xml parsing Documentation: https://xmldataset.readthedocs.io A Python library that simplifies t

James Spurin 75 Dec 30, 2022
A Python Package To Generate Strong Passwords For You in Your Projects.

shPassGenerator Version 1.0.6 Ready To Use Developed by Shervin Badanara (shervinbdndev) on Github Language and technologies used in This Project Work

Shervin 11 Dec 19, 2022
A markdown wiki and dashboarding system for Datasette

datasette-notebook A markdown wiki and dashboarding system for Datasette This is an experimental alpha and everything about it is likely to change. In

Simon Willison 19 Apr 20, 2022
A tutorial for people to run synthetic data replica's from source healthcare datasets

Synthetic-Data-Replica-for-Healthcare Description What is this? A tailored hands-on tutorial showing how to use Python to create synthetic data replic

11 Mar 22, 2022
Convert excel xlsx file's table to csv file, A GUI application on top of python/pyqt and other opensource softwares.

Convert excel xlsx file's table to csv file, A GUI application on top of python/pyqt and other opensource softwares.

David A 0 Jan 20, 2022
Modified fork of CPython's ast module that parses `# type:` comments

Typed AST typed_ast is a Python 3 package that provides a Python 2.7 and Python 3 parser similar to the standard ast library. Unlike ast up to Python

Python 217 Dec 06, 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
Feature Store for Machine Learning

Overview Feast is an open source feature store for machine learning. Feast is the fastest path to productionizing analytic data for model training and

Feast 3.8k Dec 30, 2022
Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a livereload enabled web server.

sphinx-autobuild Rebuild Sphinx documentation on changes, with live-reload in the browser. Installation sphinx-autobuild is available on PyPI. It can

Executable Books 440 Jan 06, 2023
An open source utility for creating publication quality LaTex figures generated from OpenFOAM data files.

foamTEX An open source utility for creating publication quality LaTex figures generated from OpenFOAM data files. Explore the docs » Report Bug · Requ

1 Dec 19, 2021
Żmija is a simple universal code generation tool.

Żmija Żmija is a simple universal code generation tool. It is intended to be used as a means to generate code that is both efficient and easily mainta

Adrian Samoticha 2 Nov 23, 2021
script to calculate total GPA out of 4, based on input gpa.csv

gpa_calculator script to calculate total GPA out of 4 based on input gpa.csv to use, create a total.csv file containing only one integer showing the t

Mohamad Bastin 1 Feb 07, 2022
A PyTorch implementation of Deep SAD, a deep Semi-supervised Anomaly Detection method.

Deep SAD: A Method for Deep Semi-Supervised Anomaly Detection This repository provides a PyTorch implementation of the Deep SAD method presented in ou

Lukas Ruff 276 Jan 04, 2023
Documentation for GitHub Copilot

NOTE: GitHub Copilot discussions have moved to the Copilot Feedback forum. GitHub Copilot Welcome to the GitHub Copilot user community! In this reposi

GitHub 21.3k Dec 28, 2022
Openapi-core is a Python library that adds client-side and server-side support for the OpenAPI Specification v3.

Openapi-core is a Python library that adds client-side and server-side support for the OpenAPI Specification v3.

A 186 Dec 30, 2022
A tool that allows for versioning sites built with mkdocs

mkdocs-versioning mkdocs-versioning is a plugin for mkdocs, a tool designed to create static websites usually for generating project documentation. mk

Zayd Patel 38 Feb 26, 2022
Poetry plugin to export the dependencies to various formats

Poetry export plugin This package is a plugin that allows the export of locked packages to various formats. Note: For now, only the requirements.txt f

Poetry 90 Jan 05, 2023