lmc999 / RegionRestrictionCheck

A bash script to check the status of your IP on various geo-restricted services.
GNU Affero General Public License v3.0
3.95k stars 536 forks source link

Update & Fixes #122

Closed betaxab closed 3 months ago

betaxab commented 3 months ago

Update:

  1. Use the same User-Agent
  2. Variabilized & use the same Sec-CH-UA User-Agent

Fixes:

  1. Fixes TrueID & SonyLiv check
  2. Fixes a minor typo

About TrueID:

Sucess:

{
    "isPlay": true,
    "setting": {
        "dai": {
            "sz": "640x480",
            "isEnable": true,
            "adSRV": "DFP",
            "companion": "728x90,320x100",
            "devType": "web"
        },
        "nielsen": {
            "enable": false,
            "dcr_crossid2": "th-thairathlivetrueid c01",
            "dcr_enable": "yes",
            "dcr_live": "TrueID-ThairathTVLive",
            "dcr_name": "TrueID-ThairathTVLivestream",
            "dcr_vcid": "c20"
        }
    },
    "billboardType": "LOADING",
    "billboardPlayerProps": {
        "id": "8v732AYomo9",
        "message": "Success",
        "stream": {
            "stream_url": "https://cdn727.stm.trueid.net/p201dai/d05_multi_w_auto_tidapp.smil/playlist.m3u8?appid=trueid&type=live&visitor=web&drm=aes&uid=7d6e531d0b&did=Rjl4ZWJ6eTZWTmtleUI5aHFKaHY1YVpON3VzaVpXN1U&mpass=v3wlgLEAW6zi5Zn_lGIBwu4h8iQbw-VaGtSx_2HovGulLulZX8s3FdvDj3QXT-ar0w8U-s-edCHi2k82Z3JiiYW8oh61iLJJm3oKu74UEmf-ffVfLSWXh-1roki8FYxIICAF1kx_JmRjc3c3c8X0tlO0&sid=f245d470ce&rt=1715262416&ds=86400&tk=5hiYY1DWpZc1zAAdtE6GCvhhEvfj_ig5KgK3bZQth5g",
            "stream_license": null,
            "stream_version": null,
            "stream_interval": "300",
            "drm": "aes",
            "audio": {
                "original": "aac",
                "thai": "aac"
            },
            "video": {
                "1280x720": "hvc1.1.6.L93.B1.0.0.1",
                "1920x1080": "hvc1.1.6.L120.B1.0.0.1",
                "960x540": "avc1.4d401f"
            }
        },
        "drm": "aes",
        "playready": "",
        "web_genre": "Entertainment",
        "robustness": ""
    },
    "tier": [
        "non-login"
    ],
    "ads": "https://pubads.g.doubleclick.net/gampad/live/ads?sz=640x480&iu=/21682623839/TrueID_Web_Video/Live_TV/ThairathTV-HD&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cmsid=2494419&vid=8v732AYomo9&url=https://tv.trueid.net/live/thairathtv-hd&description_url=https://tv.trueid.net/live/thairathtv-hd&correlator=[timestamp]&cust_params=StreamType%3DLive%26prasarnid%3D&ppid="
}

Failed:

{
    "isPlay": false,
    "setting": {},
    "billboardType": "GEO_BLOCK",
    "billboardPlayerProps": {
        "message": "text_error_geoblock"
    },
    "tier": []
}

About SonyLiv

Sony LIV is available in India, Pakistan, UAE, Qatar, Kuwait, Saudi Arabia, Oman, Bahrain, Bangladesh, Nepal, Sri Lanka, Maldives, Bhutan, Afghanistan, Malaysia, Singapore, Hong Kong, Macau, China, Taiwan, Australia, New Zealand, Philippines, Indonesia, Thailand, Germany, Switzerland, Norway, Netherlands, Spain, France, United Kingdom, Italy, Portugal, Ireland, Austria, Sweden, Belgium, Denmark, Finland, Greece, Poland and Canada. It's also available in the United States via Sling TV and as a standalone app.

See: https://en.wikipedia.org/wiki/SonyLIV

Success:

{
    "resultCode": "OK",
    "message": "",
    "errorDescription": "200-10000",
    "resultObj": {
        "showPlayerStats": false,
        "is_preview_enabled": false,
        "videoURL": "https://sonynondrmvod.akamaized.net/11cae87e-a492-4707-a0ea-d17ab10886b1/trailer_lampan_dated_1_59sec.mpd?hdnea=exp=1715353518~acl=/*~id=25a417c3b5f246a393fadb022adc82d5-1715309762699~hmac=ded9378bbf4573d7036cc9085255fa6527ebaab1f644ebdd4d7e0a057eb364fe",
        "multiLanguageVideoURL": [],
        "audioLanguages": [
            {
                "audioId": 1,
                "audioLanguageName": "HIN",
                "isPreferred": true
            }
        ],
        "trailer_url": "NA",
        "subtitle": [],
        "isEncrypted": false,
        "isDVR": false,
        "downloadMaxDays": 999,
        "isDownloadable": true,
        "isFromTLB": true,
        "isDefault": false,
        "posterURL": "",
        "sprite_image_url": "https://sprite.sonyliv.com/Img/f/trailer_lampan_dated_1_59sec_192_108_8.jpg",
        "tv_sprite_image_url": "https://sprite.sonyliv.com/Img/f/trailer_lampan_dated_1_59sec_640_360_8.jpg",
        "dai_asset_key": "",
        "contextual_cue_point": {},
        "cuepoints": [],
        "isLive": false,
        "country_rating": "{\"U/A 13+\":\"IN\",\"12+\":\"BD,NP,BT,LK,MV,AF,PK,MU,AE,SA,KW,QA,OM,BH,MY,ID,TH,HK,PH,SG,GB,AU,ZA,JM,GY,TT,JP,CN,NZ,US,CA,AT,BE,BG,HR,CY,CZ,DK,EE,FI,FR,DE,GR,HU,IE,IT,LV,LT,LU,MT,NL,PL,PT,RO,SK,SI,ES,SE,CH,NO,NG,KE\"}",
        "dai_asset_key_hlsfp": "",
        "dai_asset_key_wm": "",
        "Maximum_Video_Quality": "SDR",
        "Maximum_Audio_Quality": "STEREO",
        "Maximum_Resolution": "FULL_HD",
        "isWatermarked": "false",
        "watermark_partner": "",
        "pcVodLabel": "U/A 13+",
        "promotionUrl": "",
        "hasPromotion": false,
        "contentProvider": "Indian Magic Eye Private Limited",
        "sony_match_id": "",
        "tl_marker": "",
        "checksum": "",
        "kid_mss": "",
        "parentId": "",
        "selectedLanguage": "",
        "isFirstVideoPlayedInDevice": false,
        "targetedDelivery": {
            "td_server_hints": {
                "pip_bw_initial": 800000,
                "pip_bw_max": 7000000,
                "pip_vod_prefetch": 30,
                "pip_vod_initial_buffer_mb": 11,
                "pip_vod_initial_buffer_sec": 12,
                "pip_vod_max_buffer_mb": 79,
                "pip_vod_max_buffer_sec": 90,
                "pip_live_initial_buffer": 8,
                "pip_live_target_latency": 10,
                "analytics_expt_id": "QgYv6eq4Nj"
            }
        },
        "parents": [
            {
                "parentId": 1700001426,
                "parentType": "GROUP_OF_BUNDLES",
                "parentSubType": "SHOW"
            }
        ],
        "additionalDataJson": {
            "audio_quality": "STEREO",
            "bitrate_ladder": {
                "1080v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 4200000,
                    "fps": 25,
                    "resolution": "1920x1080",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 50849717
                    },
                    "video_codec": "avc1.4d4028"
                },
                "1080v2": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 5500000,
                    "fps": 25,
                    "resolution": "1920x1080",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 67624507
                    },
                    "video_codec": "avc1.4d4028"
                },
                "144v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 200000,
                    "fps": 25,
                    "resolution": "256x144",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 2035257
                    },
                    "video_codec": "avc1.4d400c"
                },
                "240v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 300000,
                    "fps": 25,
                    "resolution": "426x240",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 3375212
                    },
                    "video_codec": "avc1.4d4015"
                },
                "360v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 500000,
                    "fps": 25,
                    "resolution": "640x360",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 6053442
                    },
                    "video_codec": "avc1.4d401e"
                },
                "480v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 800000,
                    "fps": 25,
                    "resolution": "854x480",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 9278017
                    },
                    "video_codec": "avc1.4d401e"
                },
                "540v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 1200000,
                    "fps": 25,
                    "resolution": "960x540",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 13687865
                    },
                    "video_codec": "avc1.4d401f"
                },
                "720v1": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 2000000,
                    "fps": 25,
                    "resolution": "1280x720",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 22181955
                    },
                    "video_codec": "avc1.4d401f"
                },
                "720v2": {
                    "audio_codec": "mp4a.40.2",
                    "bitrate": 3000000,
                    "fps": 25,
                    "resolution": "1280x720",
                    "size_on_disk": {
                        "audio": {
                            "hin": 1504656
                        },
                        "video": 31472274
                    },
                    "video_codec": "avc1.4d401f"
                }
            },
            "enc_format": "DASH",
            "resolution": "FULL_HD",
            "video_quality": "SDR"
        },
        "LA_Details": {},
        "packId": ""
    },
    "systemTime": 1715310318877
}

Failed:

{
    "resultCode": "KO",
    "errorDescription": "AKA_0403_PANIC",
    "message": "EPDblocked API",
    "resultObj": {},
    "systemTime": 1715319729,
    "vpn_error_img": "https://originpreprod-static.sonyliv.com/Ui_icons/vpn_error.png",
    "title": "Oops!",
    "heading1": "It seems you are trying to access SonyLIV via <b>VPN, Proxy</b> or a <b>Routed Service</b>.",
    "description": [
        "Content browsing and purchase of any subscription services are not supported over VPN, Proxy or a routing service",
        "Please turn off any such services that might route your internet connection from outside of your current region.",
        "If you have already disabled these services but still seeing this message, contact your Internet Service Provider for support.",
        "For more information you can write to us at mailto: livsupport@setindia.com."
    ],
    "exit_cta": "Exit the app!"
}