Skip to content

Instantly share code, notes, and snippets.

@Last-Order
Created October 11, 2019 11:45
Show Gist options
  • Save Last-Order/5a1c70686bc0c130fe3fbdcbdb1bf22a to your computer and use it in GitHub Desktop.
Save Last-Order/5a1c70686bc0c130fe3fbdcbdb1bf22a to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Abema 区域限制
// @version 1.0.0
// @run-at document-end
// @namespace Violentmonkey Scripts
// @match https://abema.tv/*
// @grant none
// ==/UserScript==
Object.defineProperty(__CLIENT_REGION__, 'isAllowed', {
get: () => true
});
Object.defineProperty(__CLIENT_REGION__, 'status', {
get: () => false
});
@HenryCode96
Copy link

现在挂着日本的节点都直接跳转到不可访问节点,控制台上报错__CLIENT_REGION__ is not defined
如果不适用VPN节点的话,海外的IP又无法访问内容数据,会显示为ERR_BLOCKED_BY_CLIENT
看到网页代码中主要是这一段控制地区信息
window.__CLIENT_REGION__ = {"timezone": "Europe/Berlin", "divisionCode": 1,"isoCountryCode": "DE","cdnURL": "https://ds-glb-linear-abematv.akamaized.net/region","isAllowed": true,"status": true};
不知有无办法直接针对timezoneisoCountryCode两个属性进行劫持注入,从而实现直接通过现有地区信息判断的逻辑。
能力有限,对于JS了解甚少,还请dalao们抽空看下这个思路可行性。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment