XMLTV / xmltv

Utilities to obtain, generate, and post-process TV listings data in XMLTV format
GNU General Public License v2.0
266 stars 93 forks source link

tv_grab_na_dtv Decoding JSON response failed. Error getting channel list: check your zip code #212

Closed Dukat-Gul closed 10 months ago

Dukat-Gul commented 11 months ago

Thanks for taking the time to report an issue. Please take a moment to review our open/closed issues above, in case your issue has already been reported.

If you are reporting a new issue, please give your issue a descriptive title and fill out the blanks below, providing as much information as possible.

XMLTV Version?

./tv_grab_na_dtv --version XMLTV module version 1.2.1 This is tv_grab_na_dtv version 1.2.1

even tried a fresh git clone on Wed 09 Aug 2023 11:53:59 AWST

XMLTV Component?

/xmltv/grab/na_dtv//tv_grab_na_dtv

Perl Version

perl --version

This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linux-gnu-thread-multi (with 52 registered patches, see perl -V for more detail)

Operating System

Description: Debian GNU/Linux 12 (bookworm) Release: 12 Codename: bookworm uname -a Linux 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-1 (2023-07-14) x86_64 GNU/Linux

What happened?

when I run tv_grab_na_dtv and reference an existing configuration file - or even if I try and created a new with --configure

./tv_grab_na_dtv --configure Enter your zip code to include local channels. Zip Code: 90210 The timezone that you live in. Time Zone: 0: America/New_York 1: America/Detroit EDITED 28: Pacific/Honolulu Select one: [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 (default=0)] 1 Decoding JSON response failed. Error getting channel list: check your zip code

What did you expect to happen?

About a month ago it was fully operational, and I would be asked (for the --configuration) to select which channels to include in the configuration file. If it was run against a working configuration file it would grab the XML episode data.

Did you see any warnings/errors?

Decoding JSON response failed. Error getting channel list: check your zip code

if I run with --debug https://pastebin.com/BeX0hsXg

What steps are needed to reproduce this issue?

  1. …git clone https://github.com/XMLTV/xmltv
  2. …cd grab/na_dtv
  3. …./tv_grab_na_dtv --configure

Please attach your config file below:

Config is at the bottom of https://pastebin.com/BeX0hsXg

Any other information?

Has been working well until about a month ago and then it stopped. Tried to update to 1.2.1 and latest without improvement.

Herrminator commented 11 months ago

curl -v -A "xmltv/1.2.1" "http://www.directv.com/json/channels" returns HTTP/1.1 301 Moved Permanently and Location: https://www.directv.com/json/channels

Then, curl --fail -A "xmltv/1.2.1" "https://www.directv.com/json/channels" returns curl: (22) The requested URL returned error: 404,

Did they deactivate their API?

Dukat-Gul commented 11 months ago

I wonder if this could be helpful...

https://github.com/iptv-org/epg/issues/2038 Discusses how others had to interface due to them checking some extra headers... Accept-language and Connection... perhaps need to be introduced

https://github.com/iptv-org/epg/commit/684251ed8315cb6a1131dbe590110f597d6cef43

Im not sure how the equivalent can be modified in the grab code. I hope someone else can suggest a method.

Ive tried editing this - without any change.....

Line 464, 711 & 792 (but $programDetailsUrl instead of $CHANNEL_LIST_URL) my $resp = $browser->get($CHANNEL_LIST_URL, 'Accept-Encoding' => $can_accept, 'Accept-Language' => "en-US,en;q=0.5", 'Connection' => "keep-alive",);

Also tried to see if the Request, Cache and delay could be incorporated.... as mentioned https://github.com/iptv-org/epg/issues/2137#issuecomment-1643906760 but struggled to find a way myself.

kyl416 commented 10 months ago

Back in June, DIRECTV discontinued their online satellite guide and replaced it with their stream.directv.com guide, which is only accessible if you have an active satellite or streaming account. For a while the json pages that powered the previous online guide were still accessible, but eventually they also wiped them from their server.

DIRECTV uses Gracenote for their guide data, so you can get the same data with a Schedules Direct subscription and tv_grab_zz_sdjson or tv_grab_zz_sdjson_sqlite. Although Gracenote doesn't have listings for some of their in house channels like their Live4K and PPV Event channels.

It may be possible to do a complete rewrite of tv_grab_na_dtv to support the stream.directv.com guide if someone can figure out a way for users to pass along their account credentials needed to generate the authorization bearer header for the channel and schedule API requests, but the era of the data being available to non-DIRECTV subscribers is over.

rmeden commented 10 months ago

hmmm sounds dead.. any objections to removing it from the active distro?

knowledgejunkie commented 10 months ago

Having read the updated thread I was going to do this later anyway - feel free to remove it!