Coder Social home page Coder Social logo

Request: Add the possibility to get subtitle link (instead of downloading) or a json output with all related links. about soaper-dl HOT 5 CLOSED

kevcui avatar kevcui commented on June 3, 2024
Request: Add the possibility to get subtitle link (instead of downloading) or a json output with all related links.

from soaper-dl.

Comments (5)

KevCui avatar KevCui commented on June 3, 2024

Hi @fboumol, that sounds right. I added it in the latest comment. Give it a try!

from soaper-dl.

fboumol avatar fboumol commented on June 3, 2024

Thank you. It works great.

Unfortunately, it is not working the following command (running it in the shell)

 series="/tv_aTo2Mjs.html"; epi="1.1"
 urlvideo=$(./soap2day-dl.sh -p "${series}" -e "${epi}" -l)
 urlsubtitle=$(./soap2day-dl.sh -p "${series}" -e "${epi}" -s -l)
 mpv --sub-file="${urlsubtitle}" "${urlvideo}"

The reason is that urlsubtitle is in the domain soap2day, and it requires the right headers to acces them (even curl without the right headers does not allow to download the subtitle). But it works if one uses the cookie information provided by soap2day, i.e., using

 series="/tv_aTo2Mjs.html"; epi="1.1"
 urlvideo=$(./soap2day-dl.sh -p "${series}" -e "${epi}" -l)
 urlsubtitle=$(./soap2day-dl.sh -p "${series}" -e "${epi}" -s -l)
 # the right values for xxx and yyy can be obtained looking at the javascript console (in chromium, firefox, ...) when accessing soap2day domain
 headers=(  'User-Agent: xxx','Cookie: yyy' ) 
 mpv --http-header-fields="${headers[@]}" --sub-file="${urlsubtitle}" "${urlvideo}"

it works. But unfortunately one needs to find the right value of "yyy" (while "xxx" can be constant), and I only know how to get it using a non automatic way (i.e., looking myself in the firerox javascript console).

Can your code of the file "getResponse.js" be easily modified to also provide in its json output the headers information your code uses? I am not familiar enough with puppeteer to know how to do it.

I suspect that an obvious advantage of providing this info would be that the shell script can be easily modified to be faster (only the first download would require the use of puppeteer).

from soaper-dl.

KevCui avatar KevCui commented on June 3, 2024

Hi @fboumol, right. You could use this https://github.com/KevCui/soap2day-dl/blob/840172c088ec20f8cb2b1cea0354b12426eed1bb/bin/getCookie.js to download cookies.

from soaper-dl.

fboumol avatar fboumol commented on June 3, 2024

Awesome, it works like a charm.

One last wondering around puppeteer. Is there any documentation (manual, reference, web pages, etc) you could suggest me to read to understand why your code works? I am looking for first-hand experience, something you have benefited from.

from soaper-dl.

KevCui avatar KevCui commented on June 3, 2024

Hi @fboumol, good to hear that it works for you! Regarding Puppeteer doc, you could check their official site https://pptr.dev/#?product=Puppeteer or visit their current API doc https://github.com/puppeteer/puppeteer/blob/v13.3.2/docs/api.md.

from soaper-dl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.