Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

where can I make changes in chrome extension to add one more site support? #7

Open
ilovefood2 opened this issue May 27, 2019 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ilovefood2
Copy link

im wondering where to make changes so that it supports a website that I want?

thanks

@vide0
Copy link
Member

vide0 commented May 29, 2019

Before modify extension codes, please ensure Node.js development environment is configured in your computer.

If you want capture more video request from other website. You can modify patterns in ./src/config.js

And you can ask me in here if you meet other problem when you trying to modify this extension

@ilovefood2
Copy link
Author

ilovefood2 commented Jun 3, 2019

thanks
i did take a look at ./src/config.js

so how come there are PROCESSABLE_M3U8_PATTERN and VIDEO_PAGE_PATTERN ? does it mean i only need to add pattern in VIDEO_PAGE_PATTERN ?

@vide0
Copy link
Member

vide0 commented Jun 3, 2019

Actually, the logic of capture the video links is as follows:

  1. Listening each request in Chrome via API onBeforeRequest with filter M3U8_PATTERN_ARRAY
  2. Log request (You can find it in extension's console)
  3. Check is this request sender page matched the VIDEO_PAGE_PATTERN. Get page's type if matched.
  4. Check is url of this m3u8 request matched the PROCESSABLE_M3U8_PATTERN. And is this m3u8 file need be decoded (field: base64Encoded)
  5. Generate download command.

Example, if you want to add a site support, you need to do these modifications:

  • Example site: example.com
  • Example m3u8 file: example.com/m3u8/xddsddsdawdawdawd
  1. Add *://example.com/m3u8/* into M3U8_PATTERN_ARRAY
  2. Add { pattern: /example\.com\// } into PROCESSABLE_M3U8_PATTERN
  3. Add { pattern: /example\.com/, type: 'example' } into VIDEO_PAGE_PATTERN
  4. Modify code about SUPPORTED_PAGE_TYPE in AvgleDownloader and Avgle

By the way, I am optimizing the script. You can keep an eye on it.

@vide0 vide0 added good first issue Good for newcomers help wanted Extra attention is needed labels Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants