A Python module to interact with the Sdarot API. For educational purposes only, of course.
Start by installing the extra modules neeed to run this project:
pip install -r requirements.txt
PySdarot offers 2 ways of using it- through a Python API, or by running it with command line arguments.
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
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
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
To see all the commands and functionality, you can open the help menu like this:
python pysdarot.py -h
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.