mirror of
https://github.com/alantang1977/X.git
synced 2024-11-06 02:43:08 +02:00
Add files via upload
This commit is contained in:
parent
6ceea35eb8
commit
941a897149
7 changed files with 5905 additions and 39 deletions
Binary file not shown.
|
@ -1 +1 @@
|
||||||
da00d6247a1d8e38c4bcf1f364dda405
|
ea296ea7754d08b7a80c118503ace366
|
||||||
|
|
|
@ -5,12 +5,17 @@ import re
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
|
import gzip
|
||||||
|
|
||||||
p=re.compile(r'.*/s/(.*)')
|
p=re.compile(r'.*/s/(.*)')
|
||||||
|
skipp = re.compile(r'.*(cover|screen|频道).*',re.IGNORECASE)
|
||||||
reqcount=1
|
reqcount=1
|
||||||
sharedict=set()
|
sharedict=set()
|
||||||
|
|
||||||
def getlist(shareid, fileid):
|
def getlist(w,shareid, fileid,morepage):
|
||||||
|
global p
|
||||||
|
global skipp
|
||||||
global reqcount
|
global reqcount
|
||||||
global sharedict
|
global sharedict
|
||||||
|
|
||||||
|
@ -18,7 +23,7 @@ def getlist(shareid, fileid):
|
||||||
if reqcount % 5 == 0:
|
if reqcount % 5 == 0:
|
||||||
print(f"reqcount:{reqcount} shareid:{shareid} fileid:{fileid}",file=sys.stderr)
|
print(f"reqcount:{reqcount} shareid:{shareid} fileid:{fileid}",file=sys.stderr)
|
||||||
#time.sleep(1)
|
#time.sleep(1)
|
||||||
url = f'http://192.168.101.188:9978/proxy?do=pikpak&type=list&share_id={shareid}&file_id={fileid}&pass_code='
|
url = f'http://192.168.101.188:9978/proxy?do=pikpak&type=list&share_id={shareid}&file_id={fileid}&pass_code=&morepage={morepage}'
|
||||||
print(f"url: {url}",file=sys.stderr)
|
print(f"url: {url}",file=sys.stderr)
|
||||||
resp = requests.get(url)
|
resp = requests.get(url)
|
||||||
content = resp.content.decode('utf-8')
|
content = resp.content.decode('utf-8')
|
||||||
|
@ -30,6 +35,8 @@ def getlist(shareid, fileid):
|
||||||
if isfirst:
|
if isfirst:
|
||||||
isfirst=False
|
isfirst=False
|
||||||
print(f"first line:{line}",file=sys.stderr)
|
print(f"first line:{line}",file=sys.stderr)
|
||||||
|
if skipp.match(line):
|
||||||
|
continue
|
||||||
linearr = line.split('\t')
|
linearr = line.split('\t')
|
||||||
if len(linearr)>2:
|
if len(linearr)>2:
|
||||||
m = p.match(linearr[0])
|
m = p.match(linearr[0])
|
||||||
|
@ -42,45 +49,70 @@ def getlist(shareid, fileid):
|
||||||
if shareid+"/"+fileid in sharedict:
|
if shareid+"/"+fileid in sharedict:
|
||||||
print(f"skip shareid{shareid} fileid:{fileid}", file=sys.stderr)
|
print(f"skip shareid{shareid} fileid:{fileid}", file=sys.stderr)
|
||||||
continue
|
continue
|
||||||
print(line)
|
w.write(line+"\n")
|
||||||
|
w.flush()
|
||||||
if linearr[2] == "folder":
|
if linearr[2] == "folder":
|
||||||
getlist(shareid,fileid)
|
getlist(w,shareid,fileid,False)
|
||||||
|
|
||||||
|
if len(lines)>0:
|
||||||
|
getlist(w,shareid,fileid,True)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
with(open(sys.argv[1]+".txt","r",encoding="utf-8")) as f:
|
f = gzip.open(sys.argv[1]+".raw.gz",mode="rt",encoding="utf-8")
|
||||||
while True:
|
if f is not None:
|
||||||
lines = f.readlines()
|
print(f"found gz raw file:{sys.argv[1]}.raw.gz, extract it",file=sys.stderr)
|
||||||
if len(lines)<=0:
|
with(open(sys.argv[1]+".raw","w",encoding="utf-8")) as w:
|
||||||
break
|
while(True):
|
||||||
for line in lines:
|
lines = f.readlines()
|
||||||
linearr = line.split("\t")
|
if len(lines)<=0:
|
||||||
m = p.match(linearr[0])
|
break
|
||||||
if m:
|
for line in lines:
|
||||||
arr = m.group(1).split("/")
|
line=line.strip()
|
||||||
else:
|
w.write(line+"\n")
|
||||||
arr = linearr[0].split("/")
|
f.seek(0)
|
||||||
if len(arr)>1:
|
|
||||||
shareid = arr[0]
|
|
||||||
fileid = arr[1]
|
|
||||||
sharedict.add(shareid+"/"+fileid)
|
|
||||||
except:
|
except:
|
||||||
pass
|
traceback.print_exc()
|
||||||
with(open(sys.argv[1],"r",encoding="utf-8")) as f:
|
try:
|
||||||
j = json.load(f)
|
f = open(sys.argv[1]+".raw","r",encoding="utf-8")
|
||||||
for c in j:
|
except:
|
||||||
shareid=c.get("type_id")
|
f = None
|
||||||
fileid=""
|
if f is not None:
|
||||||
m = p.match(shareid)
|
print("found old raw file")
|
||||||
if m:
|
while True:
|
||||||
arr = m.group(1).split("/")
|
lines = f.readlines()
|
||||||
else:
|
if len(lines)<=0:
|
||||||
arr = shareid.split("/")
|
break
|
||||||
shareid=arr[0]
|
for line in lines:
|
||||||
fileid=arr[1] if len(arr)>1 else ""
|
linearr = line.split("\t")
|
||||||
if shareid+"/"+fileid in sharedict:
|
m = p.match(linearr[0])
|
||||||
continue
|
if m:
|
||||||
getlist(shareid,fileid)
|
arr = m.group(1).split("/")
|
||||||
|
else:
|
||||||
|
arr = linearr[0].split("/")
|
||||||
|
if len(arr)>1:
|
||||||
|
shareid = arr[0]
|
||||||
|
fileid = arr[1]
|
||||||
|
sharedict.add(shareid+"/"+fileid)
|
||||||
|
f.close()
|
||||||
|
print(f"old raw file record:{len(sharedict)}")
|
||||||
|
else:
|
||||||
|
print("no old raw file")
|
||||||
|
with(open(sys.argv[1]+".raw","a+",encoding="utf-8")) as w:
|
||||||
|
with(open(sys.argv[1],"r",encoding="utf-8")) as f:
|
||||||
|
j = json.load(f)
|
||||||
|
for c in j:
|
||||||
|
shareid=c.get("type_id")
|
||||||
|
fileid=""
|
||||||
|
m = p.match(shareid)
|
||||||
|
if m:
|
||||||
|
arr = m.group(1).split("/")
|
||||||
|
else:
|
||||||
|
arr = shareid.split("/")
|
||||||
|
shareid=arr[0]
|
||||||
|
fileid=arr[1] if len(arr)>1 else ""
|
||||||
|
if shareid+"/"+fileid in sharedict:
|
||||||
|
continue
|
||||||
|
getlist(w,shareid,fileid,False)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
5833
pg/lib/gzlive.txt
Normal file
5833
pg/lib/gzlive.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
||||||
[
|
[
|
||||||
{"type_id":"https://mypikpak.com/s/VNRT8Wr8BGyw1kt1HkijKR4Qo1", "type_name":"高清劇集合集一二", "version":"202401011655"},
|
{"type_id":"https://mypikpak.com/s/VNRT8Wr8BGyw1kt1HkijKR4Qo1", "type_name":"高清劇集合集一二", "version":"20240106"},
|
||||||
{"type_id":"https://mypikpak.com/s/VNThL9vJ7kj57e2Kr_dlOzc0o1", "type_name":"每日更新" },
|
{"type_id":"https://mypikpak.com/s/VNThL9vJ7kj57e2Kr_dlOzc0o1", "type_name":"每日更新" },
|
||||||
{"type_id":"https://mypikpak.com/s/VNBG3CPruacfHy3KVrVR1Qbko1","type_name":"/🕸️我的PikPak分享/电视剧140T/电视剧1"},
|
{"type_id":"https://mypikpak.com/s/VNBG3CPruacfHy3KVrVR1Qbko1","type_name":"/🕸️我的PikPak分享/电视剧140T/电视剧1"},
|
||||||
{"type_id":"https://mypikpak.com/s/VNBXQHEBywwEP48SYNoLGhg-o1","type_name":"/🕸️我的PikPak分享/电视剧140T/电视剧10"},
|
{"type_id":"https://mypikpak.com/s/VNBXQHEBywwEP48SYNoLGhg-o1","type_name":"/🕸️我的PikPak分享/电视剧140T/电视剧10"},
|
||||||
|
|
Binary file not shown.
|
@ -35,5 +35,6 @@
|
||||||
"pikpak_thread_limit":2,
|
"pikpak_thread_limit":2,
|
||||||
"pikpak_vip_thread_limit":2,
|
"pikpak_vip_thread_limit":2,
|
||||||
"pikpak_proxy":"",
|
"pikpak_proxy":"",
|
||||||
|
"pikpak_proxy_onlyapi":false,
|
||||||
"pikpak_danmu":true
|
"pikpak_danmu":true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue