๐ŸŒฑ 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
EasyMultiClipboard - Python script written to handle more than 1 string in clipboard

EasyMultiClipboard - Python script written to handle more than 1 string in clipboard

WVlab 1 Jun 18, 2022
My solutions to the Advent of Code 2021 problems in Go and Python ๐ŸŽ„

๐ŸŽ„ Advent of Code 2021 ๐ŸŽ„ Summary Advent of Code is an annual Advent calendar of programming puzzles. This year I am doing it in Go and Python. Runnin

Orfeas Antoniou 16 Jun 16, 2022
300+ Python Interview Questions

300+ Python Interview Questions

Pradeep Kumar 1.1k Jan 02, 2023
ACPOA plugin creation helper

ACPOA Plugin What is ACPOA ACPOA is the acronym for "Application Core for Plugin Oriented Applications". It's a tool to create flexible and extendable

Leikt Sol'Reihin 1 Oct 20, 2021
Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

5.1k Jan 02, 2023
Plugins for MkDocs.

Plugins for MkDocs and Python Markdown pip install neoteroi-mkdocs This package includes the following plugins and extensions: Name Description Type m

35 Dec 23, 2022
Zero configuration Airflow plugin that let you manage your DAG files.

simple-dag-editor SimpleDagEditor is a zero configuration plugin for Apache Airflow. It provides a file managing interface that points to your dag_fol

30 Jul 20, 2022
Data Inspector is an open-source python library that brings 15++ types of different functions to make EDA, data cleaning easier.

Data Inspector Data Inspector is an open-source python library that brings 15 types of different functions to make EDA, data cleaning easier. Author:

Kazi Amit Hasan 38 Nov 24, 2022
Python Programming (Practical) (1-25) Download ๐Ÿ‘‡๐Ÿผ

BCA-603 : Python Programming (Practical) (1-25) Download zip ๐Ÿ™‚ ๐ŸŒŸ How to run programs : Clone or download this repo to your computer. Unzip (If you d

Milan Jadav 2 Jun 02, 2022
Mozilla Campus Club CCEW is a student committee working to spread awareness on Open Source software.

Mozilla Campus Club CCEW is a student committee working to spread awareness on Open Source software. We organize webinars and workshops on different technical topics and making Open Source contributi

Mozilla-Campus-Club-Cummins 8 Jun 15, 2022
Grokking the Object Oriented Design Interview

Grokking the Object Oriented Design Interview

Tusamma Sal Sabil 2.6k Jan 08, 2023
A next-generation curated knowledge sharing platform for data scientists and other technical professions.

Knowledge Repo The Knowledge Repo project is focused on facilitating the sharing of knowledge between data scientists and other technical roles using

Airbnb 5.2k Dec 27, 2022
EasyModerationKit is an open-source framework designed to moderate and filter inappropriate content.

EasyModerationKit is a public transparency statement. It declares any repositories and legalities used in the EasyModeration system. It allows for implementing EasyModeration into an advanced charact

Aarav 1 Jan 16, 2022
JTEX is a command line tool (CLI) for rendering LaTeX documents from jinja-style templates.

JTEX JTEX is a command line tool (CLI) for rendering LaTeX documents from jinja-style templates. This package uses Jinja2 as the template engine with

Curvenote 15 Dec 21, 2022
A website for courses of Major Computer Science, NKU

A website for courses of Major Computer Science, NKU

Sakura 0 Oct 06, 2022
Showing potential issues with merge strategies

Showing potential issues with merge strategies Context There are two branches in this repo: main and a feature branch feat/inverting-method (not the b

Rubรฉn 2 Dec 20, 2021
The source code that powers readthedocs.org

Welcome to Read the Docs Purpose Read the Docs hosts documentation for the open source community. It supports Sphinx docs written with reStructuredTex

Read the Docs 7.4k Dec 25, 2022
Gtech ฮผLearn Sample_bot

Ser_bot Gtech ฮผLearn Sample_bot Do Greet a newly joined member in a channel (random message) While adding a reaction to a message send a message to a

Jerin Paul 1 Jan 19, 2022
Python script to generate Vale linting rules from word usage guidance in the Red Hat Supplementary Style Guide

ssg-vale-rules-gen Python script to generate Vale linting rules from word usage guidance in the Red Hat Supplementary Style Guide. These rules are use

Vale at Red Hat 1 Jan 13, 2022