diff --git a/LICENSE b/LICENSE index 775d92d..bcce465 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 Jef LeCompte +Copyright (c) 2021 Jeffrey LeCompte Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e74e40a..7755966 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ services: -I -D -C /config/.zap2xmlrc -o /xmltv/xmltv.xml SLEEPTIME: 43200 # 12 hours in seconds TZ: America/New_York + USER_AGENT: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" # Optional: customize user agent volumes: - /path/to/appdata/zap2xml:/config - /path/to/appdata/xmltv:/xmltv # nice for mapping other drives to this that may use xmltv.xml diff --git a/zap2xml.pl b/zap2xml.pl index 659c14a..937c83d 100755 --- a/zap2xml.pl +++ b/zap2xml.pl @@ -75,6 +75,8 @@ $sleeptime = 0; $allChan = 0; $shiftMinutes = 0; +$userAgent = $ENV{USER_AGENT} || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36'; + $outputXTVD = 0; $lineuptype; $lineupname; @@ -909,7 +911,7 @@ sub login { $ua->conn_cache(LWP::ConnCache->new( total_capacity => undef )); $ua->cookie_jar(HTTP::Cookies->new); $ua->proxy(['http', 'https'], $proxy) if defined($proxy); - $ua->agent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36'); + $ua->agent($userAgent); $ua->default_headers->push_header('Accept-Encoding' => 'gzip, deflate'); }