-
-
Notifications
You must be signed in to change notification settings - Fork 254
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
Zap2it.com #2679
Zap2it.com #2679
Conversation
Some notes: On Zap2it Antenna lineups have a blank "device" value so you need to remove the "!device" check so people can use it to get listings as many cities have antenna only subchannels that are not carried by any cable or sat provider:
i.e. for WRNNDT3 in NYC zip code 10036, this would be the required "site_id" value: If you want to be able to download more than 2 days, you also need to make sure the timestamp parameter doesn't change based on the date you request. The API request fails if the timestamp is more than 1 day into the future, so a quick workaround to get the full 14 days was to remove the "date" from the const timestamp line so it would always use the current time: epg-grabber v0.38.0 now sends "EPGGrabber" as the default User-Agent, which zap2it blocks, so you need to supply a browser based User-Agent in the headers. |
I corrected this part const [device, lineupId, headendId, countryCode, postalCode, prgsvcid] = channel.site_id.split('/')
i added the user-agent... And the last part, the code works with the information of the 14 days but it is limited with this part return programs.filter(p => dayjs(p.start).add(dayjs(p.start).utcOffset(), 'minute').isBetween(date.startOf('day').utc(), date.endOf('day').utc(), 'second', '[]')) because it is too much information. And if it works with previous days or not I really don't know, what I know is that as it is currently it gets the information for the correct day. |
Fixes #2372 npm test --- zap2it.com
> test
> run-script-os zap2it.com
> test:win32
> SET "TZ=Pacific/Nauru" && npx jest --runInBand zap2it.com
PASS sites/zap2it.com/zap2it.com.test.js (8.375 s)
√ can generate valid url (12 ms)
√ can parse response (17 ms)
√ can handle empty guide (3 ms)
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 9.146 s
Ran all test suites matching /zap2it.com/i. npm run grab --- --site=zap2it.com
> grab
> npx tsx scripts/commands/epg/grab.ts --site=zap2it.com
starting...
config:
output: guide.xml
maxConnections: 1
gzip: false
site: zap2it.com
loading channels...
found 595 channel(s)
run #1:
[1/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/91035 - Feb 10, 2025 (8 programs)
[2/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/91035 - Feb 11, 2025 (8 programs)
[3/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/114483 - Feb 11, 2025 (9 programs)
[4/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/60222 - Feb 11, 2025 (19 programs)
[5/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/60222 - Feb 10, 2025 (19 programs)
[6/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/114483 - Feb 10, 2025 (8 programs)
[7/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/62077 - Feb 11, 2025 (24 programs)
[8/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/62077 - Feb 10, 2025 (24 programs)
[9/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/11069 - Feb 11, 2025 (19 programs)
[10/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/11069 - Feb 10, 2025 (19 programs)
[11/1190] zap2it.com (es) - X/USA-DITV-DEFAULT/DITV/USA/12084/16604 - Feb 11, 2025 (10 programs)
... |
No description provided.