mar-mei / guide2go

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

[ERROR] json: cannot unmarshal number into Go struct field SDSchedule.stationID of type string #13

Closed klatka closed 3 years ago

klatka commented 3 years ago

Describe the bug

Download schedules fail with error: json: cannot unmarshal number into Go struct field SDSchedule.stationID of type string

config_cache.json is empty: { "Channel": {}, "Program": {}, "Metadata": {}, "Schedule": {} }

To Reproduce Steps to reproduce the behavior:

  1. Create a configuration (see README.md)
  2. Run guide2go -config /path/config.yaml
  3. See error

Expected behavior

Successful loading of schedules and a populated config.xml file.

Screenshots

guide2go -config /path/config.yaml
2020/09/22 22:18:59 [G2G  ] Version: 1.1.2
2020/09/22 22:18:59 [URL  ] https://json.schedulesdirect.org/20141201/token
2020/09/22 22:18:59 [SD   ] Login...OK

2020/09/22 22:18:59 [URL  ] https://json.schedulesdirect.org/20141201/status
2020/09/22 22:19:00 [SD   ] Account Expires: 2021-07-11 20:57:17 +0000 UTC
2020/09/22 22:19:00 [SD   ] Lineups: 2 / 4
2020/09/22 22:19:00 [SD   ] System Status: Online [No known issues.]
2020/09/22 22:19:00 [G2G  ] Channels: 427
2020/09/22 22:19:00 [URL  ] https://json.schedulesdirect.org/20141201/lineups/DEU-1000095-DEFAULT
2020/09/22 22:19:00 [URL  ] https://json.schedulesdirect.org/20141201/lineups/DEU-1000097-DEFAULT
2020/09/22 22:19:00 [G2G  ] Download Schedule: 7 Day(s)
2020/09/22 22:19:00 [URL  ] https://json.schedulesdirect.org/20141201/schedules
2020/09/22 22:19:05 [ERROR] json: cannot unmarshal number into Go struct field SDSchedule.stationID of type string
2020/09/22 22:19:05 [G2G  ] Download Program Informations: New: 0 / Cached: 0
2020/09/22 22:19:05 [G2G  ] Download missing Metadata: 0 
2020/09/22 22:19:05 [G2G  ] Create XMLTV File [/path/config.xml]
2020/09/22 22:19:05 [G2G  ] Clean up Cache [/path/config_cache.json]
2020/09/22 22:19:05 [G2G  ] Deleted Program Informations: 0

Additional context

config.yaml:

Account:
    Username: ***
    Password: ***
Files:
    Cache: /path/config_cache.json
    XMLTV: /path/config.xml
Options:
    Poster Aspect: all
    Schedule Days: 7
    Subtitle into Description: false
    Insert credits tag into XML file: true
    Rating:
        Insert rating tag into XML file: true
        Maximum rating entries. 0 for all entries: 1
        Preferred countries. ISO 3166-1 alpha-3 country code. Leave empty for all systems: []
        Use country code as rating system: false
    Show download errors from Schedules Direct in the log: false
Station:
  - Name: DMAX Austria HD
    ID: "101673"
    Lineup: DEU-1000097-DEFAULT
  - Name: Deluxe Music HD Austria
    ID: "106108"
    Lineup: DEU-1000097-DEFAULT
  - Name: Deluxe Music TV Europe
    ID: "83569"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 1
    ID: "97076"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 2
    ID: "97094"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 3
    ID: "97075"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 4
    ID: "99737"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 5
    ID: "99738"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 6
    ID: "99741"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 7
    ID: "99742"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 8
    ID: "99739"
    Lineup: DEU-1000097-DEFAULT
  - Name: Eurosport 360 HD 9
    ID: "99734"
    Lineup: DEU-1000097-DEFAULT
  - Name: FOX
    ID: "83584"
    Lineup: DEU-1000097-DEFAULT
...
tentious commented 3 years ago

I just pushed PR #14.

klatka commented 3 years ago

Seems to be a bug from schedulesdirect...

Topic at schedulesdirect: https://forums.schedulesdirect.org/viewtopic.php?f=15&t=3107 Related to: https://github.com/SchedulesDirect/JSON-Service/issues/81

tentious commented 3 years ago

Thanks, I'll pull down my PR. If you need this working like RIGHT NOT feel free to use. :D

klatka commented 3 years ago

I just pushed PR #14.

Works for me. Thanks!

tentious commented 3 years ago

@klatka as soon as SD gets this bug squashed, my changes will break, so just revert back to master - 1.1.2.

klatka commented 3 years ago

SD resolved that issue: https://forums.schedulesdirect.org/viewtopic.php?f=15&t=3107&start=10