Giter Club home page Giter Club logo

pysdarot's Introduction

PySdarot

A Python module to interact with the Sdarot API. For educational purposes only, of course.

Installation

Start by installing the extra modules neeed to run this project:

pip install -r requirements.txt

Usage

PySdarot offers 2 ways of using it- through a Python API, or by running it with command line arguments.

Command Line

Initial Setup

Start by running the config commmand to add the current TLD. For example, if the current URL is sdarot.tv:

python pysdarot.py config --tld tv

To search up shows/movies, you don't need to sign in. However, to download them, you will need to. You can add your username and password like this:

python pysdarot.py config --username my_sdarot_user --password my_sdarot_pass

Searching for shows

You can find content using the search command:

python pysdarot.py search money heist

This is what the command gave me, note the number on the left is the show ID:

[+] Found the following shows:
[3284] בית הנייר / Money Heist
[7375] בית הנייר: מטוקיו ועד ברלין / Money Heist: From Tokyo to Berlin
[8085] בית הנייר: קוריאה - קוריאנית / Money Heist Korea Joint Economic Area
[8830] בית הנייר: קוריאה - אנגלית / Money Heist: Korea – Joint Economic Area

Downloading shows

Once you've found your show, use the download command to save the content to a file. Pass the URL of the show, the season number, and the episode number. For example, here the number 1 indicates we want to download the first season, and the number 2 indicates we want to download the second episode of that season.

python pysdarot.py download https://www.sdarot.tw/watch/3284 1 2

You can also pass the show ID directly, like this:

python pysdarot.py download 3284 1 2

To download the entire season in one go, use -1 as the episode number. This example will downlaod the entirety of the first season:

python pysdarot.py download 3284 1 -1

More help

To see all the commands and functionality, you can open the help menu like this:

python pysdarot.py -h

Python API

The PySdarot Python API makes it easy to programmatically download shows and movies from the website. There are many great examples in the examples folder (really, check them out!), but anyways here is a very short snippet of how to import and use the base API class:

from pysdarot import PySdarot

# Username and password are only required if you want to download
s = PySdarot('.tw', 'my_sdarot_user', 'my_sdarot_pass')

The above code will create a new instance of the API class, where the domain is configured as sdarot.tw, and it will log into your account using your username and password.

License

GNU AFFERO GENERAL PUBLIC LICENSE, SEE README

pysdarot's People

Contributors

xiddoc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.