Skip to content

Instantly share code, notes, and snippets.

@Isopach
Created November 12, 2021 01:50
Show Gist options
  • Save Isopach/3e22b238d3703a0b3233fb76c89f11c5 to your computer and use it in GitHub Desktop.
Save Isopach/3e22b238d3703a0b3233fb76c89f11c5 to your computer and use it in GitHub Desktop.
LINEでブロックされたか確認する
# 1. Get a JSON list of your friends from GET /api/present/friends
# サンプルデータ: [{"imageUrl":"https://profile.line-scdn.net/サンプル/large","name":"サンプル","midCrypted":"aVSDサンプル=="},{"imageUrl":"https://profile.line-scdn.net/サンプル2/large","name":"サンプル2",...省略...}]
# 2. Copy header and cookies from GET /api/present/friends/
import json, requests, urllib3, time, sys
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
f = open("linefriends_mid.txt", "r", encoding="utf-8")
d = json.loads(f.read())
f.close()
for i in range(0,len(d)):
try:
mid = sys.argv[1]
params = (
('packageId', '5381358'), # 一般的に人気のなさそうスタンプがおすすめ
('confirmedPrice', '\uFFE5250'),
('presentTemplateId', '0'),
('toUserMid', mid),
)
res = requests.get('https://store.line.me/stickershop/payment', headers=headers, params=params, cookies=cookies, verify=False)
if res.status_code == 200:
print(list(filter(lambda x:x["midCrypted"]==mid,d)))
elif res.status_code == 302 or res.status_code == 500:
print("Safe: " + str(list(filter(lambda x:x["midCrypted"]==mid,d))[0]["name"]))
print(list(filter(lambda x:x["midCrypted"]==mid,d)))
break
except IndexError:
mid = d[i]["midCrypted"]
params = (
('packageId', '5381358'), # 一般的に人気のなさそうスタンプがおすすめ
('confirmedPrice', '\uFFE5250'),
('presentTemplateId', '0'),
('toUserMid', mid),
)
res = requests.get('https://store.line.me/stickershop/payment', headers=headers, params=params, cookies=cookies, verify=False)
if res.status_code == 200:
print(str(d[i]["name"]))
print(d[i]["midCrypted"])
elif res.status_code == 302 or res.status_code == 500:
print("Safe: "+str(d[i]["name"]))
time.sleep(1.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment