Skip to main content

python3 subscene api wrapper

Project description

SUBSCENE-API (v 0.2):link:

Open Source Love MIT Licence forthebadge made-with-python
Generic badge Generic badge Generic badge

subscene API also known as subtitle API is an unofficial API of subscene subtitle provider which is written in python3 by using web scrapping tools and techniques.This api allows you to fetch subtitles list,download links as well as subtitles(in ZIP format) on the basis of the movie's title and other parameters (they are discribed below in the Usage section).

:small_blue_diamond:How to install ?

Dependencies :

Subscene API requires:

  • python (>=3.7)
  • requests (==2.23.0)
  • beautifulsoup4 (==4.9.0)

below given code works in both terminal and cmd:heavy_check_mark: It can be installed using pip

  $  pip install subsceneAPI==<version>

since the current version is 0.1. You can write

  $  pip install subsceneAPI==0.1

To test if the installation was sucessiful,try:

  $  subsceneAPI -v 
    OR
  $  subsceneAPI --version

For successful installation, the expected output is :

  $  subscene-API 0.2

Usage:

subscene API can be use both from command line and as a python package. Command line is not recommended here because it is just for testing purpose and all the features of the package are not included in CLI version. This API can be useful for developing subtitle downloader and any other web based project which includes subtitle information.

:computer: Command Line Usage:

All the commands for subscene API can be found using help flag.

  $  subsceneAPI -h
    OR
  $  subsceneAPI --help

To get the list of available subtitles along with download links, try :

  $  subsceneAPI -t "movie title/name" -y "2020" -lng "english"
    OR
  $  subsceneAPI --title "movie title/name" --year "2020" --language "english"

Remember,
-t or --title and -y or --year is mandatory. The default argument for -lng or --language is "english".You can find the possible choices for language in --help result


:page_with_curl: Library Usage: (recommended):heavy_check_mark:

Import module subtitle from the package subsceneAPI
  import subsceneAPI
  from subsceneAPI import subtitle

Now,
create an instance of subscene object by using function :

    search(title="<movie name>",year="<yrs>,language="<language>",limit="<no of subtitles that you want>")

:heavy_exclamation_mark:Note, the title is mandatory but not the limit and year.Although,year argument should be pass for more accurate and expected result.In addition, the default value for limit is 1 and all other possible values are positive integers and 'all'. With the value 'all', every available subtitles' information will be fetched.

For instance ,

  import subsceneAPI
  # or more ofthen,
  from subsceneAPI import subtitle    
  obj = subtitle.search(title="extraction",year="2020",language="english",limit="1")

A simple implementation :

>>>   from subsceneAPI import subtitle
>>>   sub = subtitle.search(title="extraction",year="2020",language="english",limit="2")
>>>   print(sub.ZIPlinks) # or obj.showZIPlinks()

[('후아유 학교 2015.E01~E16.HDTV.H264.720p-WITH ',
 'https://www.subscene.com/subtitles/arabic-text/PU109MKIN052gH-c1GWyOCfTWLMLKmlfMrQXJcMMwO6b288LtEhtMIfkExgzB7hs8R0xZVR460THHwMT1PZ4iOPs6Vh_BjVhUJUfUxTc9yW8wCJ_tUbDzkpFsw4ofmIL0'),
('Who.Are.You.School-2015.E02-16.END.XviD-WITH-iPOP ',
 'https://www.subscene.com/subtitles/arabic-text/EgiL6LXr7Kp3bTtOT9fezovIu-6a5NcuPm66f8JPgPEP9HYHdM3yCXr9pQME2-hTCZeiPHusemyNgyVxVcW9qp6hmY3GCPJxXPuFBDWmb4XP58RNtbs8Gkij9EBxBiuv0')]

obj.ZIPlinks

  • contains the list of tuples of subtitle name and the download link of ZIPPed .srt file

To download ZIP files:

  • download in current directory:
  >>> sub.downloadZIP()
  • download at any absolute path:
 >>> sub.downloadZIP(path="<abs path>")

Developement:

Contibuters of all experience levels are warmly welcomed to be the part of the subscene API community.The community goals are to be helpful,welcoming,effective.

important links:

source code:

you can check the latest sources with the command :

       git clone https://github.com/s-4-m-a-n/subscene-API.git

LICENSE:

It is an open source project and is being licensed under MIT LICENSE - click me to get to the license file for more details. It is not an official subscene version : 4.0 product.

Facebook Twitter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subsceneAPI-0.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

subsceneAPI-0.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file subsceneAPI-0.2.tar.gz.

File metadata

  • Download URL: subsceneAPI-0.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for subsceneAPI-0.2.tar.gz
Algorithm Hash digest
SHA256 2d034cb4f744f1397130ac0203472c9e43e3f79ea59cff599bf8ddff143685c8
MD5 1e2dfdb1ed82e0d41a13d2ed2a199483
BLAKE2b-256 59c5fe61a2a14028ae2c660791d4192b32bc7f69506f50641d0fe0a917f9c7b4

See more details on using hashes here.

File details

Details for the file subsceneAPI-0.2-py3-none-any.whl.

File metadata

  • Download URL: subsceneAPI-0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for subsceneAPI-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9bba174879f8761c0a3696d0a5eb727a14cf88d5c16b0c2d7c35211caa4caffb
MD5 b1231c8bc6f94212498e88050a69c5a6
BLAKE2b-256 f64eb57379a3338477b87503a9cd5597c45bd73f0b7681d9d739038cb01b6d71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page