Created
July 12, 2022 14:30
-
-
Save motebaya/364f13c23c1d92ea08461d5f0cbb00a6 to your computer and use it in GitHub Desktop.
just for check whatsapp group invite url sttil valid or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get from https://www.linkgrupwa.link/ just for check the invite url still valid or not | |
# if active will be save it to file | |
import requests | |
import re | |
import json | |
session = requests.Session() | |
session.headers["user-agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" | |
ok, no = 1, 1 | |
if (feed := list(dict.fromkeys([x["link"][-1]["href"] for x in json.loads(re.search(r"(?<=findPostDate\()(.*?)(?=\);)", session.get(f"https://www.linkgrupwa.link/feeds/posts/summary", params={"start-index": "1", "max-results": "100", "alt": "json-in-script", "callback": "findPostDate"}).text).group(1))["feed"]["entry"]]))): | |
for v, i in enumerate(feed, 1): | |
print(f" ({v}/{len(feed)}) fetching {i.split('/')[-1]}") | |
if (href := re.findall(r"(?<=<a\shref\=\")(http[s]\:\/\/chat.*?)\".*?(?=<\/a>)", session.get(i).text)): | |
for y, x in enumerate(href, 1): | |
if (n := re.findall(r"(?:<img\s.*src\=\".*?\">[\s\S]*?<\/a><h3\sclass.*?>([^>]*?)<\/h3><h4\s.*?>.*?<\/h4><a\shref\=\"(.*?)\")", session.get(x).text)): | |
if (len(n[0][0]) != 0): | |
with open("valid.txt", "a", encoding="utf-8") as f: | |
print( | |
f" ({y}/\033[92m{ok}\033[0m) {n[0][0]} : {n[0][-1]}") | |
f.write(f"{n[0][0]}|{n[0][1]}\n") | |
ok += 1 | |
else: | |
print(f" ({y}/\033[91m{no}\033[0m]) not") | |
no += 1 | |
continue | |
else: | |
continue | |
else: | |
continue | |
else: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment