mrdotb / yifysubtitles Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I am on Ubuntu 16.04 LTS, I've successfully installed your package with npm i yifysubtitles --save
although I got some warnings:
npm WARN enoent ENOENT: no such file or directory, open '/root/package.json'
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.
But every time I try to run your example on the front page with node I am getting the following error:
TypeError: Cannot read property 'tt1156398' of undefined
at runConditional (/root/node_modules/yifysubtitles/index.js:64:37)
at apiCall.then.res (/root/node_modules/yifysubtitles/index.js:82:42)
at process._tickCallback (internal/process/next_tick.js:109:7)
Any ideas on how to fix this?
Hi,
is it possibile to add an option on yifysubtitles call (like paths, langs...) to download the subtitles in srt format instead vvt?
Thanks.
I'm writing a new nodejs module using your lib and realized there's a problem regarding your key/value mapping for languages:
Line 14 in 75ee908
As you can see in screenshot, I inspected the Persian language row:
I got this error while testing this code:
`const yifysubtitles = require('yifysubtitles')
const getSubs = async () => {
try{
const results = await yifysubtitles('tt1375666', {
path: '/subs',
langs: ['ar']
})
}catch(err){
console.error('error: ', err)
}
}
getSubs()`
full error body:
GotError [HTTPError]: Response code 403 (Forbidden)
at EventEmitter. (E:\WebDev\Node\subs\node_modules\got\source\as-promise.js:74:19)
at processTicksAndRejections (internal/process/task_queues.js:95:5) {
host: 'www.yifysubtitles.com',
hostname: 'www.yifysubtitles.com',
method: 'GET',
path: '/movie-imdb/tt1375666',
socketPath: undefined,
protocol: 'https:',
url: 'https://www.yifysubtitles.com/movie-imdb/tt1375666',
gotOptions: {
path: '/movie-imdb/tt1375666',
protocol: 'https:',
slashes: true,
auth: null,
host: 'www.yifysubtitles.com',
port: null,
hostname: 'www.yifysubtitles.com',
hash: null,
search: null,
query: null,
pathname: '/movie-imdb/tt1375666',
href: 'https://www.yifysubtitles.com/movie-imdb/tt1375666',
retry: {
retries: [Function (anonymous)],
methods: [Set],
statusCodes: [Set],
errorCodes: [Set]
},
headers: {
'user-agent': 'got/9.6.0 (https://github.com/sindresorhus/got)',
'accept-encoding': 'gzip, deflate'
},
hooks: {
beforeRequest: [],
beforeRedirect: [],
beforeRetry: [],
afterResponse: [],
beforeError: [],
init: []
},
decompress: true,
throwHttpErrors: true,
followRedirect: true,
stream: false,
form: false,
json: false,
cache: false,
useElectronNet: false,
method: 'GET'
},
statusCode: 403,
statusMessage: 'Forbidden',
headers: {
date: 'Sun, 25 Jul 2021 10:53:59 GMT',
'content-type': 'text/html',
'transfer-encoding': 'chunked',
connection: 'close',
vary: 'Accept-Encoding',
'cf-cache-status': 'DYNAMIC',
'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
'report-to': '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=LU8kcWWCvUqWVcVzvj0TgXa0Q77menyXpA40hAJFrPvGXwUXUT4tD6qq%2BtWIup1wHiVXuWGYy6A7kkXFCguPhkZ9%2FVEQrbVKfF6cIJmiBEtvu4tiQFr3DKDdKJgizUkOe5BD%2F4a3cj0%3D"}],"group":"cf-nel","max_age":604800}',
nel: '{"report_to":"cf-nel","max_age":604800}',
server: 'cloudflare',
'cf-ray': '6744d8fe8fb91141-MAD',
'content-encoding': 'gzip',
'alt-svc': 'h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400'
},
body: '\r\n' +
'<title>403 Forbidden</title>\r\n' +
'\r\n' +
'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.