mar-mei / guide2go

Schedules Direct JSON to XML grabber
MIT License
60 stars 15 forks source link

[ERROR] invalid character '<' looking for beginning of value #23

Open kegbeach opened 2 years ago

kegbeach commented 2 years ago

guide2go frequently throws the error "[ERROR] invalid character '<' looking for beginning of value" and fails to fetch guide data.

2022/01/16 00:00:02 [G2G ] Version: 1.1.3 2022/01/16 00:00:02 [URL ] https://json.schedulesdirect.org/20141201/token 2022/01/16 00:00:04 [SD ] Login...OK 2022/01/16 00:00:04 [URL ] https://json.schedulesdirect.org/20141201/status 2022/01/16 00:00:13 [SD ] Account Expires: 2022-02-14 23:07:14 +0000 UTC 2022/01/16 00:00:13 [SD ] Lineups: 4 / 4 2022/01/16 00:00:13 [SD ] System Status: Online [No known issues.] 2022/01/16 00:00:13 [G2G ] Channels: 501 2022/01/16 00:00:13 [URL ] https://json.schedulesdirect.org/20141201/lineups/X 2022/01/16 00:00:15 [URL ] https://json.schedulesdirect.org/20141201/lineups/X 2022/01/16 00:00:17 [URL ] https://json.schedulesdirect.org/20141201/lineups/X 2022/01/16 00:00:19 [URL ] https://json.schedulesdirect.org/20141201/lineups/X 2022/01/16 00:00:21 [G2G ] Download Schedule: 5 Day(s) 2022/01/16 00:00:21 [URL ] https://json.schedulesdirect.org/20141201/schedules 2022/01/16 00:05:33 [ERROR] invalid character '<' looking for beginning of value <-- HERE IS THE ERROR 2022/01/16 00:05:33 [G2G ] Download Program Informations: New: 0 / Cached: 0 2022/01/16 00:05:33 [G2G ] Download missing Metadata: 0 2022/01/16 00:05:34 [G2G ] Create XMLTV File [/path/to/schedule.xml] 2022/01/16 00:05:34 [G2G ] Clean up Cache [/path/to/cache.json] 2022/01/16 00:05:34 [G2G ] Deleted Program Informations: 0

guide2go doesn't always throw this error. It's hit or miss but it happens quite frequently that it needs to be reported. This has been an issue for almost a year. guide2go should automatically detect errors like this and either 1) retry or 2) fail gracefully without over writing my old guide data. Or both. I would prefer it fails gracefully and not over write my old guide data so when xTeVe/Plex refresh the guide before I notice the problem the guide won't break.

garryalexander commented 2 years ago

The son of a bitch you raised doesn't help at all. I guarantee his wife ran off with someone else.

kegbeach commented 2 years ago

If anyone else experiences the above error and is looking for a quick fix I have created a very simple bash script to loop the program until it completes successfully. Maybe later I will dig more into the app and fix the real issue at hand but for now here is the quick fix:

https://github.com/kegbeach/guide2go_scripts/blob/main/guide2go.sh

buroa commented 2 years ago

This is happening again.

EDIT: Looks like it was something where they banned my IP. I changed it again and the error went away.

kegbeach commented 2 years ago

If you're getting "[ERROR] invalid character '<' looking for beginning of value" during random parts of the guide update then I don't think it has anything to do with your IP being banned. I have success running my script to retry until successful and it never has to loop more than 1-2 times. My IP never changes.

I could be wrong but this seems to happen the most at midnight EST when I have the cron set to execute. Noon EST seems to always work the first time.

garryalexander commented 2 years ago

I stopped using guide2go. I adapted tv_grab_zz_sdjson_sqlite as per my needs (I just added an age rating, episode-num onscreen, live tag, etc.). It turned out great. Do the same and get rid of the bugs.

https://github.com/garybuhrmaster/tv_grab_zz_sdjson_sqlite/blob/main/tv_grab_zz_sdjson_sqlite