Simple API for Resonite for getting movies and series from a jellyfin server.
Note: Like Jellyfin the developers of the server and the clients are not responsible of what YOU are doing with this tools.
The issues for the repository handle both this server and the Resonite client.
Requirements:
- Python
3.7 libgl1
Then you can simply use the command pip install . for example.
Their is also a docker image available at
https://hub.docker.com/r/spacealicornnetwork/jellyfin2txt but keep in
mind for building the path for the tessdata best for tesseract-ocr
is hardcorded in the folder tessdata_best at the root of the project.
You will need to put the data in this folder. See near the end of the file
in the Extracting hardcoded subtitles explanation.
For launch the server your just need to run the scrip app.py:
usage: app.py [-h] [--port PORT] [--debug]
optional arguments:
-h, --help show this help message and exit
--port PORT Port to use, default 5000
--debug Make the server verbose
Each endpoint of the API is currently lock behind a key you can manage with
the little script key.py.
usage: key.py [-h] [genkey ...] [revokekey ...] [listkeys ...]
script 1.0
positional arguments:
genkey Generate a new key
revokekey Revoke a key. The format should be key=<id>
listkeys List all the key available
optional arguments:
-h, --help show this help message and exit
The API have 4 endpoints:
Each endpoint response is sended without a new line at the end. Each entry
is separated by ;. But beware the first entry is not a proper entry for the
endpoints movies and series. Its the pagging system information in the
folowing format: start_index,total_record_count.
/movies/Return the list of movies where an item is in the formatname,img_url,dl_url,stream_url,trailer_url,external_url. This endpoint also support two url parameters:StartIndexthat you can use for start from a special index. Default to 0.Limitthat you can use for set a limit of the number of item to get from the server. Default to 100.ThumbFillHeightthat you can use for change the height of the thumbnail. Default to 320.
ThumbFillWidththat you can use for change the width of the thumbnail. Default to 213.ThumbQualitythat you can use for change the quality of the thumbnail, in percent. Default to 96.
/series/Return the list of series where an item is in the formatname,img_url,serie_id,external_url. This endpoint also support two url parameters:StartIndexthat you can use for start from a special index. Default to 0.Limitthat you can use for set a limit of the number of item to get from the server. Default to 100.ThumbFillHeightthat you can use for change the height of the thumbnail. Default to 320.
ThumbFillWidththat you can use for change the width of the thumbnail. Default to 213.ThumbQualitythat you can use for change the quality of the thumbnail, in percent. Default to 96.
/series/<serie_id>Return the list of seasons of the serie where an item is in the formatname,img_url,season_id/series/<serie_id>/<sesaon_id>Return the list of episode of the season of the serie where an item is in the formatname,img_url,dl_url,stream_url/subtitles/<media_id>Return the list of subtitles available for a media where media can either be a movie or an episode./subtitles/<media_id>/<subtitle_name>Return the subtitle url available on the proxy./subtitles/<media_id>/<subtitle_name>/extractExtract the subtitle from the server. This process can be very long if the subtitle is burned in the media. SeeExtracting hardcoded subtitles./subtiles/<media_id>/<subtitle_name>/extract/statusReturn the status of the extraction process in the formatsrt_name,status,item_id,item_name,error_message,created_at,updated_atwherecreated_atandupdated_atare in milliseconds./subtiles/<media_id>/discoverReturn the subtitles availables based on the language set in the configuration file./subtiles/<media_id>/allReturn all the subtitles available on the proxy./extract_statusReturn the list of all the status of the extraction processes in the formatsrt_name,status,item_id,item_name,error_message,created_at,updated_atwherecreated_atandupdated_atare in milliseconds. Each task is separated by the\n.
For authentification the API search in the POST data as a json with the key auth_key. The value is
directly the key.
Example with curl:
curl -d '{"auth_key":"xxxxxxxxxxxx"}' -H "Content-Type: application/json" -X POST https://jellyfin2text.example.com
A public folder is available for a basic Resonite client called JellyfinClient Beta (Old NeosVR client not tested in Resonite!):
resrec:///G-The-french-microwave/R-cb7e384b-3879-4395-be1f-ea4a74c09705
The beta version 0.3 have a key where you will need to put the differents
infomation in a slot called DynVar just under the root of the of the Jellyfin client:
Client/BaseUrlis the url of the server you want to use as a proxyClient/AuthKeyis the auth key generated from thekey.pyutility needed to access to the server.
This proxy is capabale to serve the following subtitles format:
subripdirectlyass,move_textextracted from jellyfin and converted insrtPGSSUBextracted from the movie via OCR and converted insrt
You need to have installed on your system the binary mkvmerge available in MKVToolNix.
You also need to have tesseract-ocr and the tessdata best. (For pgsrip)
$ git clone https://github.com/tesseract-ocr/tessdata_best.git
export TESSDATA_PREFIX=~/tessdata_best
Subtitles in this format are using the external module https://github.com/ratoaq2/pgsrip. If you want to be able to extract file in this format you free RAM must be big enough for have the movie fit inside. Example if you movie is 2GB you need more than 2GB of RAM available.
- The stream url didnt work yet probably because of this issue: Neos-Metaverse/NeosPublic#2812
- The download url didnt work because Neos dont reconize the file extension
For still being able to see the file of your choice you will need to copy the download url and open it into your navigator before importing in Neos. Its better to use the Neos cloud as a storage for streame your file. There is an option in a context menu to copy the url. If you want to save the cassette you will need to remove the InventoryLink using the option on the context menu. Keep in mind the option to copy the link can break at any time.