Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

[Run avgleHPD using Greasemonkey] videojs is not defined #2

Closed
jcchikikomori opened this issue Aug 20, 2020 · 6 comments
Closed

[Run avgleHPD using Greasemonkey] videojs is not defined #2

jcchikikomori opened this issue Aug 20, 2020 · 6 comments

Comments

@jcchikikomori
Copy link

Screen Shot 2020-08-20 at 10 30 06 AM

@avotoko
Copy link
Owner

avotoko commented Aug 20, 2020

Let me ask you some questions to understand the situation.

  1. Please tell me the url of the page where the error occurs.
  2. Do you always get the same error on the page?
  3. Do you get the same error on all other video pages?
  4. Can you play the video without running avgleHPD? avgle uses videojs to display videos. If the error always occurs on the video page, the video itself may not be playable.
  5. Are you running avgleHPD as a bookmarklet?

@jcchikikomori
Copy link
Author

1. Please tell me the url of the page where the error occurs.

https://avgle.com/video/LAeMnMhDoMq/pxd-029-premium-terrace-house

2. Do you always get the same error on the page?

Yes

3. Do you get the same error on all other video pages?

Yes. I tried other videos but same result

4. Can you play the video without running avgleHPD? avgle uses videojs to display videos. If the error always occurs on the video page, the video itself may not be playable.

I don't know how to use avgleHPD. I am testing this with MacOS, so maybe I have a limited options to use

5. Are you running avgleHPD as a bookmarklet?

No. I am running with Greasemonkey

@avotoko
Copy link
Owner

avotoko commented Aug 21, 2020

Understood.
The cause of the error is that the code of avgleHPD is written in the UserScript of gracemonkey as it is.
You cannot access videojs because the scope of UserScript of gracemonkey and the scope of the target page are different.
To avoid this, inject the avgleHPD script using the script tag. If you write the following code in UserScript, avgleHPD will work normally.
(function(url,e){e=document.createElement("script");e.src=url;document.body.appendChild(e);})("https://avotoko.github.io/avgle-HLS-playlist-downloader/avgle-hls-playlist-downloader.js");

@jcchikikomori
Copy link
Author

Gotya @avotoko . Let me replicate this with your solution and i will close this when it's done

@avotoko
Copy link
Owner

avotoko commented Aug 27, 2020

Okay

@jcchikikomori
Copy link
Author

I was able now to download the HLS file

The cause of the error is that the code of avgleHPD is written in the UserScript of gracemonkey as it is.
You cannot access videojs because the scope of UserScript of gracemonkey and the scope of the target page are different.
To avoid this, inject the avgleHPD script using the script tag. If you write the following code in UserScript, avgleHPD will work normally.
(function(url,e){e=document.createElement("script");e.src=url;document.body.appendChild(e);})("https://avotoko.github.io/avgle-HLS-playlist-downloader/avgle-hls-playlist-downloader.js");

@avotoko avotoko changed the title videojs is not defined [Run avgleHPD using Greasemonkey] videojs is not defined Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants