A JavaScript library which fetches subtitles for tv shows episodes from Beta Series API.
This library works weel with Medoc.
- Detect recent episodes (default 2 day old) from a specific directory (filename must be
{show} - {season}x{episode}.{format}
); - Download first subtitle found on Beta Series for this episode next to the episode file.
$ npm install yquem
const Yquem = require("yquem")
const yquem = new Yquem(`d:`)
yquem
.run()
.then(results => {
console.log(results)
})
.catch(err => {
console.error(err)
})
Look for recent files from the specified directory, try to grab subtitles from filename, returns a Promise when done.
Return a list of recent files from the specified directory.
path
<string>
Directory to scan.fileAge
<string> | <number>
Number of days to consider a file to be recent.
Check if a subtitle file exist next to the episode file specified.
file
<string>
Complete path of a episode fileoptions
<object>
:languages
<string | array>
List of languages to look for, default:en
Search a subtitle onn Beta Series and download it next to the episode file specified.
file
<string>
Complete path of a episode fileoptions
<object>
:languages
<string | array>
List of languages to look for, default:en
Download file from a given url
.
url
<string>
URL as a string.
Get the list of subtitles found on Beta Series for an episode.
show
<object>
:name
<string>
Name of the showseason
<string> | <number>
Season numberepisode
<string> | <number>
Episode number
Extract show name from filename.
filename
<string>
Episode filename, format :Krypton - 1x01
.
Extract season number and episode number from filename.
filename
<string>
Episode filename, format :Smallville - 6x08
.
Get the show object from Beta Series API.
name
<string>
Show name.
Get the episode object from Beta Series API.
id
<string | number>
Show identifier.episode
<string>
Episode description, format :S01E01
.
Write a new file to destinationPath
.
data
<buffer>
Date of the new file.destinationPath
<string>
Complete path of the new file.
Return the formatted episode name, ie : Final Space - 2x03
.
name
<string>
Name of the showseason
<string> | <number>
Season numberepisode
<string> | <number>
Episode number