StationID changed to integer?

Use this forum to discuss issues related to the SD-JSON service.
purplebottle
Posts: 4
Joined: Mon Sep 21, 2020 9:26 pm

StationID changed to integer?

Post by purplebottle »

After today's small outage it seems the StationID for the schedules endpoint has changed to an integer which seems to have broken my schedule downloader :-(

Code: Select all

curl -s -XPOST -H "token: HIDDEN" -H "Content-Type: application/json" -d '[{"stationID":"16604"}]' https://json.schedulesdirect.org/20141201/schedules | jq
[
  {
    "stationID": 16604,    <-------
    "programs": [
      {
        "programID": "EP022124660353",
        "airDateTime": "2020-09-22T00:00:00Z",
        "duration": 7200,
From the documentation it seems a string should be expected?
https://github.com/SchedulesDirect/JSON ... stationids
stationID - max 12 characters. Mandatory. This is a string, and your code must not treat it as an integer. Provides information to the grabber regarding the stationID that this schedule is for.

rkulagow
SD Staff
Posts: 933
Joined: Tue Aug 14, 2007 3:15 pm

Re: StationID changed to integer?

Post by rkulagow »

That's a regression in the code. I'm fixing it now and re-building the schedules.

rkulagow
SD Staff
Posts: 933
Joined: Tue Aug 14, 2007 3:15 pm

Re: StationID changed to integer?

Post by rkulagow »

Schedules have been rebuilt.

ombre33
Posts: 3
Joined: Mon Sep 21, 2020 12:19 pm

Re: StationID changed to integer?

Post by ombre33 »

Hi,

thank you, but I still get the same error from my grabber as I mentioned in the other thread:

Code: Select all

2020/09/22 20:24:46 [URL  ] https://json.schedulesdirect.org/20141201/status
2020/09/22 20:24:47 [SD   ] Account Expires: 2021-05-08 12:45:40 +0000 UTC
2020/09/22 20:24:47 [SD   ] Lineups: 2 / 4
2020/09/22 20:24:47 [SD   ] System Status: Online [No known issues.]
2020/09/22 20:24:47 [G2G  ] Channels: 52
2020/09/22 20:24:47 [URL  ] https://json.schedulesdirect.org/20141201/lineups/DEU-1001951-DEFAULT
2020/09/22 20:24:47 [URL  ] https://json.schedulesdirect.org/20141201/lineups/ZZZ-19.2E-DEFAULT
2020/09/22 20:24:47 [G2G  ] Download Schedule: 10 Day(s)
2020/09/22 20:24:47 [URL  ] https://json.schedulesdirect.org/20141201/schedules
2020/09/22 20:24:49 [ERROR] json: cannot unmarshal number into Go struct field SDSchedule.stationID of type string
2020/09/22 20:24:49 [G2G  ] Download Program Informations: New: 0 / Cached: 0
2020/09/22 20:24:49 [G2G  ] Download missing Metadata: 0
2020/09/22 20:24:49 [G2G  ] Create XMLTV File [/guide2go/schedulesdirect.xml]
2020/09/22 20:24:49 [G2G  ] Clean up Cache [/guide2go/schedulesdirect_cache.json]
2020/09/22 20:24:49 [G2G  ] Deleted Program Informations: 0

rkulagow
SD Staff
Posts: 933
Joined: Tue Aug 14, 2007 3:15 pm

Re: StationID changed to integer?

Post by rkulagow »

Is the issue with stationID 16604? I just checked on the server, and all of the schedules now have strings for the stationID, like they're supposed to.

purplebottle
Posts: 4
Joined: Mon Sep 21, 2020 9:26 pm

Re: StationID changed to integer?

Post by purplebottle »

ID 16604 now seems to be returned as a string as expected.

I just tried for a different ID and that seems to come back as an integer. :?

Code: Select all

$ curl -s -X POST -H "token:HIDDEN" -H "Content-Type: application/json" -d '[{"stationID":"33648"}]' https://json.schedulesdirect.org/20141201/schedules | jq
[
  {
    "stationID": 33648,
    "programs": [
      {
        "programID": "EP014704950053",
        "airDateTime": "2020-09-22T00:00:00Z",
        "duration": 3600,
        "md5": "cdSwk51f4utITIQxe7XW0A",
        "audioProperties": [
          "cc"
        ],


rkulagow
SD Staff
Posts: 933
Joined: Tue Aug 14, 2007 3:15 pm

Re: StationID changed to integer?

Post by rkulagow »

I'm going to re-rebuild the schedules to squash this bug.

rkulagow
SD Staff
Posts: 933
Joined: Tue Aug 14, 2007 3:15 pm

Re: StationID changed to integer?

Post by rkulagow »

Schedules have been re-built.

purplebottle
Posts: 4
Joined: Mon Sep 21, 2020 9:26 pm

Re: StationID changed to integer?

Post by purplebottle »

rkulagow wrote:
Tue Sep 22, 2020 12:45 pm
Schedules have been re-built.
Thanks for looking into this matter. Of the 47 stations I pull in there are still 17 stations appearing as ints.

Code: Select all

    "stationID": 24294
    "stationID": 69974
    "stationID": 87694
    "stationID": 87710
    "stationID": 87717
    "stationID": 87722
    "stationID": 87724
    "stationID": 87730
    "stationID": 87731
    "stationID": 87734
    "stationID": 87759
    "stationID": 87764
    "stationID": 87773
    "stationID": 87781
    "stationID": 87811
    "stationID": 87812
    "stationID": 99651

lycheemcpie
Posts: 4
Joined: Tue Sep 22, 2020 7:19 am

Re: StationID changed to integer?

Post by lycheemcpie »

Sorry but this has not fixed my problem which is the same as ombre33

The three lineups I use are
2020/09/22 21:24:11 [URL ] https://json.schedulesdirect.org/201412 ... -0005995-X
2020/09/22 21:24:11 [URL ] https://json.schedulesdirect.org/201412 ... 63-DEFAULT
2020/09/22 21:24:12 [URL ] https://json.schedulesdirect.org/201412 ... -NY63086-X

which all give an error

2020/09/22 21:24:14 [ERROR] json: cannot unmarshal number into Go struct field SDSchedule.stationID of type string

Post Reply