DrKain / scrape-youtube

A lightning fast package to scrape YouTube search results
MIT License
112 stars 30 forks source link

proxy #25

Closed abolfazlMKazemi closed 3 years ago

abolfazlMKazemi commented 3 years ago

hi thanks for this source code how use proxy if blocket my ip?

DrKain commented 3 years ago

As mentioned in the readme you can pass custom request options

const options = {
    requestOptions: {
        host: 'some.proxy.com',
        port: 8080
    }
};

youtube.search('Poets of the fall', options);
abolfazlMKazemi commented 3 years ago

thanks😘

On Mon, Dec 14, 2020 at 12:39 AM Kain notifications@github.com wrote:

As mentioned in the readme https://github.com/DrKain/scrape-youtube#custom-request-options you can pass custom request options https://nodejs.org/api/http.html#http_http_request_options_callback

const options = { requestOptions: { host: 'some.proxy.com', port: 8080 }}; youtube.search('Poets of the fall', options);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DrKain/scrape-youtube/issues/25#issuecomment-744068770, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHBY3ST7ZFDP635YLGOBOOTSUUUPDANCNFSM4UZZBXKQ .

abolfazlMKazemi commented 3 years ago

hi set value but i have error (node:34540) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established

On Mon, Dec 14, 2020 at 9:43 AM aspa viramaham viramaham@gmail.com wrote:

thanks😘

On Mon, Dec 14, 2020 at 12:39 AM Kain notifications@github.com wrote:

As mentioned in the readme https://github.com/DrKain/scrape-youtube#custom-request-options you can pass custom request options https://nodejs.org/api/http.html#http_http_request_options_callback

const options = { requestOptions: { host: 'some.proxy.com', port: 8080 }}; youtube.search('Poets of the fall', options);

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DrKain/scrape-youtube/issues/25#issuecomment-744068770, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHBY3ST7ZFDP635YLGOBOOTSUUUPDANCNFSM4UZZBXKQ .

DrKain commented 3 years ago

That's an issue with whatever proxy you're using, not this package.

abolfazlMKazemi commented 3 years ago

thanks . create custom proxy in my server and test with chrome and firefox . but set in requestoprions show this error =

(node:54717) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 172.217.21.206:3128 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1135:16) (node:54717) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:54717) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code..

and in my server log no show any request please help me

DrKain commented 3 years ago

ECONNREFUSED means it couldn't connect to your proxy server.