A script for scraping all the EPG sources. #1656
Stealthx3
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is an .sh script that serves as the trigger-pull for the IPTV-EPG project currently on my system. It was created to solve problems encountered when attempting to scrape all possible EPG sources.
update-epg.sh
Prerequisites:
The command used to trigger the script should look something like this:
PARALLEL=4 NODE_HEAP_MB=3072 GRAB_DAYS=3 epg/../update-epg.shProblems this script attempts to address:
Its function is currently divided into 3 phases:
Phase 1:
Phase 2:
The script reads each individual url in list.txt and runs them in place of "example.com" in the following command, at a time, until the list is completed:
npm run grab --- --sites=example.com --output=public/guides/{site}.xmlPhase 3:
The script will copies the contents of all the individual xml files in the public/guides directory into one monolithic xml file and ensures it properly reads out as an xmltv file.
Afterword:
A better way to handle this long term on the project side would probably be to break up the individual channel retrievals into more abstract blocks of a size that results in less than a set amount of heap allocated, as that would also help mitigate bans triggered by DDOS detection at each website and allow for more simultaneous connections since the individual connections they are more spread out.
Yes, I made Claude do it but I made sure to audit the results and now you can too.
All reactions