MainSilent / Discord-Screenshare

First ever discord video screenshare SELFBOT
297 stars 80 forks source link

javascript error: video is not defined #10

Closed saeedkhatami closed 2 years ago

saeedkhatami commented 2 years ago

*typed p youtube_link bot says please wait and after that this is log:**

/mnt/c/Users/b4d/ubuntu/Discord-Screenshare/node_modules/selenium-webdriver/lib/error.js:517
    let err = new ctor(data.message)
              ^

JavascriptError: javascript error: video is not defined
  (Session info: headless chrome=96.0.4664.45)
    at Object.throwDecodedError (/mnt/c/Users/b4d/ubuntu/Discord-Screenshare/node_modules/selenium-webdriver/lib/error.js:517:15)
    at parseHttpResponse (/mnt/c/Users/b4d/ubuntu/Discord-Screenshare/node_modules/selenium-webdriver/lib/http.js:642:13)
    at Executor.execute (/mnt/c/Users/b4d/ubuntu/Discord-Screenshare/node_modules/selenium-webdriver/lib/http.js:568:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async thenableWebDriverProxy.execute (/mnt/c/Users/b4d/ubuntu/Discord-Screenshare/node_modules/selenium-webdriver/lib/webdriver.js:731:17) {
  remoteStacktrace: '#0 0x7fc9eef10ee3 <unknown>\n' +
    '#1 0x7fc9ee9de608 <unknown>\n' +
    '#2 0x7fc9ee9e148c <unknown>\n' +
    '#3 0x7fc9ee9e1286 <unknown>\n' +
    '#4 0x7fc9ee9e1e42 <unknown>\n' +
    '#5 0x7fc9eea460a3 <unknown>\n' +
    '#6 0x7fc9eea32272 <unknown>\n' +
    '#7 0x7fc9eea453bc <unknown>\n' +
    '#8 0x7fc9eea32163 <unknown>\n' +
    '#9 0x7fc9eea07bfc <unknown>\n' +
    '#10 0x7fc9eea08c05 <unknown>\n' +
    '#11 0x7fc9eef42baa <unknown>\n' +
    '#12 0x7fc9eef58651 <unknown>\n' +
    '#13 0x7fc9eef43b05 <unknown>\n' +
    '#14 0x7fc9eef59a68 <unknown>\n' +
    '#15 0x7fc9eef3805f <unknown>\n' +
    '#16 0x7fc9eef74818 <unknown>\n' +
    '#17 0x7fc9eef74998 <unknown>\n' +
    '#18 0x7fc9eef8feed <unknown>\n' +
    '#19 0x7fc9ee446609 <unknown>\n'
}

Thank you for helping

MainSilent commented 2 years ago

Video variable is defined in stream_inject.js, If it wasn't able to find it that means the index.html page wasn't loaded successfully.

It appears you are using WSL, Can you try it on a Ubuntu virtual machine?

saeedkhatami commented 2 years ago

yeah I'm using WSL. Sure, I will install Linux on the virtual machine and I will tell you the result Thank you for helping.

saeedkhatami commented 2 years ago

log in terminal:

> DiscordStream@1.0.0 start
> node main.js

Webdriver started
Bot started
Downloading...

in discord I used *`p https://www.youtube.com/watch?v=adJFT6_j9Uk`**

terminal just shows Downloading... but in discord I got this error

:no_entry_sign: 
Error code: 1

Stderr:
ERROR: adJFT6_j9Uk: YouTube said: Unable to extract video data 
MainSilent commented 2 years ago

What version of youtube-dl are you using? Make sure the latest version is installed: https://stackoverflow.com/questions/63816790/youtube-dl-error-youtube-said-unable-to-extract-video-data

saeedkhatami commented 2 years ago

my version of YouTube-dl was for 2020 and updated to 2021.06.06 but now it downloads the video successfully and stucks at downloading...

after some minutes I got this log:

Downloading...
/home/b4d/Discord-Screenshare/node_modules/selenium-webdriver/lib/error.js:517
    let err = new ctor(data.message)
              ^

SessionNotCreatedError: session not created
from timeout: Timed out receiving message from renderer: 600.000
  (Session info: headless chrome=96.0.4664.45)
    at Object.throwDecodedError (/home/b4d/Discord-Screenshare/node_modules/selenium-webdriver/lib/error.js:517:15)
    at parseHttpResponse (/home/b4d/Discord-Screenshare/node_modules/selenium-webdriver/lib/http.js:642:13)
    at Executor.execute (/home/b4d/Discord-Screenshare/node_modules/selenium-webdriver/lib/http.js:568:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  remoteStacktrace: '#0 0x556b1389dee3 <unknown>\n' +
    '#1 0x556b1336b608 <unknown>\n' +
    '#2 0x556b13357028 <unknown>\n' +
    '#3 0x556b13355d43 <unknown>\n' +
    '#4 0x556b13356093 <unknown>\n' +
    '#5 0x556b133556c1 <unknown>\n' +
    '#6 0x556b13364d30 <unknown>\n' +
    '#7 0x556b13355663 <unknown>\n' +
    '#8 0x556b133569d9 <unknown>\n' +
    '#9 0x556b13355d43 <unknown>\n' +
    '#10 0x556b13356093 <unknown>\n' +
    '#11 0x556b133556c1 <unknown>\n' +
    '#12 0x556b1335d980 <unknown>\n' +
    '#13 0x556b1335d9cc <unknown>\n' +
    '#14 0x556b13355663 <unknown>\n' +
    '#15 0x556b133569d9 <unknown>\n' +
    '#16 0x556b13355d43 <unknown>\n' +
    '#17 0x556b13356093 <unknown>\n' +
    '#18 0x556b133556c1 <unknown>\n' +
    '#19 0x556b1336259d <unknown>\n' +
    '#20 0x556b13355663 <unknown>\n' +
    '#21 0x556b133569d9 <unknown>\n' +
    '#22 0x556b13355d43 <unknown>\n' +
    '#23 0x556b13356093 <unknown>\n' +
    '#24 0x556b133556c1 <unknown>\n' +
    '#25 0x556b1335decb <unknown>\n' +
    '#26 0x556b13355663 <unknown>\n' +
    '#27 0x556b133569d9 <unknown>\n' +
    '#28 0x556b13355d43 <unknown>\n' +
    '#29 0x556b13356093 <unknown>\n' +
    '#30 0x556b133556c1 <unknown>\n' +
    '#31 0x556b1335cefa <unknown>\n' +
    '#32 0x556b13355663 <unknown>\n' +
    '#33 0x556b133569d9 <unknown>\n' +
    '#34 0x556b13355d43 <unknown>\n' +
    '#35 0x556b13356093 <unknown>\n' +
    '#36 0x556b133556c1 <unknown>\n' +
    '#37 0x556b1335015a <unknown>\n' +
    '#38 0x556b13355663 <unknown>\n' +
    '#39 0x556b13355555 <unknown>\n' +
    '#40 0x556b13354ff0 <unknown>\n' +
    '#41 0x556b1336ca02 <unknown>\n' +
    '#42 0x556b133c63ea <unknown>\n' +
    '#43 0x556b133bf163 <unknown>\n' +
    '#44 0x556b13394bfc <unknown>\n' +
    '#45 0x556b13395c05 <unknown>\n' +
    '#46 0x556b138cfbaa <unknown>\n' +
    '#47 0x556b138e5651 <unknown>\n' +
    '#48 0x556b138d0b05 <unknown>\n' +
    '#49 0x556b138e6a68 <unknown>\n' +
    '#50 0x556b138c505f <unknown>\n' +
    '#51 0x556b13901818 <unknown>\n' +
    '#52 0x556b13901998 <unknown>\n' +
    '#53 0x556b1391ceed <unknown>\n' +
    '#54 0x7f66109ac609 <unknown>\n'
}

Video is in temp folder

MainSilent commented 2 years ago

Is your chromedriver version same as installed chrome browser?

saeedkhatami commented 2 years ago

yes they both are 96

MainSilent commented 2 years ago

Can you try chrome version 88 and nodejs version 14? If that didn't work I found a link that corresponds to your problem: https://stackoverflow.com/questions/40100960/session-not-created-exception-for-chrome-in-protractor

saeedkhatami commented 2 years ago

downgraded chromedriver and chrome to 88 and nodejs to 14 it downloads successfully bot joined voice channel and get lived but it's log:

> node main.js

Webdriver started
Bot started
Downloading...
Loading...
(node:9863) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
    at /home/b4d/Discord-Screenshare/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:85:15
    at /home/b4d/Discord-Screenshare/node_modules/snekfetch/src/index.js:215:21
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:9863) 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: 2)
(node:9863) [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.
MainSilent commented 2 years ago

Did it play? When bot joins the channel and starts the screenshare, You need to type *play for the video to start playing in live stream. Unfortunately I didn't have enough time for error handling on this project, If you can use the --trace-warnings so we have better understanding of the error.

saeedkhatami commented 2 years ago

Thanks, You spent a lot of time

I don't know about nodejs but I found a way to play it

again thank you for helping 💙 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= It works!!