r38 vs r39
1
if wiki=='namu':
2
api_url="wiki-api.namu.la"
3
wiki_url="namu.wiki"
4
discuss_doc="사용자:Ordeal"
5
APItoken='W8/tf8MdLpRUinfutKuF0ToCZdAFipkyrz0VsUD8EGs/ABgvvSjmw2ZY3T2mOxLQSltIPUHHEO2+m/5YHS8Wh1k/iv1cUnlJq0Je88Jt6hVG97rfvdks+Tm3+t6MfG8tKDi8pQzyLcqOrBXa5TZOH0eapjW35Jy+2VY5asHi/VM='
6
elif wiki=='theseed':
7
api_url="theseed.io"
8
wiki_url="theseed.io"
9
discuss_doc="사용자:ego"
10
APItoken='AdBYWxvQPwVtkaNKwl2Ljp6OodJsTT9+mZis8OuhE0cUwvFYu6I//v3bVXs2o3JPTWuHxpLKLptOrOlqvrLAlGET86foepv5pO0l2y9yrXsz7AtAYeZmrW+LOsGebOzAPJDro+6Ixm1U+ZHuNv2W3xY7s5e92Y4A4S5lb07jCBo='
11
else:
12
sys_stop=True
13
print('no wiki select')
1
api_url, wiki_url, discuss_doc, discuss_doc = selctwiki()
142
153
headers = {'Content-Type': 'application/json', 'Authorization': 'Bearer {}'.format(APItoken)}
164
discuss_headers = {'User-Agent': 'Mozilla/5.0'}
......
10290
response = await asession.get("https://{}/discuss/{}".format(wiki_url,discuss_doc),headers=discuss_headers)
10391
html= await self.alterResponseTry(response)
10492
self.discuss_state = re.search("\/discuss\/[\w,%,:]*#s-1",str(html))
105
await time.sleep(30)
93
time.sleep(30)
10694
self.state = False
10795
10896
def linkcheckchange(match_obj):
......
211199
replace=target['replace']
212200
target_backlinks = []
213201
backlink_value = ''
214
215
while True:
216
res = requests.get('https://{}/api/backlink/{}?from={}'.format(api_url,target_doc, backlink_value), headers = headers).json()
202
namespaces=[]
203
res = requests.get('https://{}/api/backlink/{}'.format(api_url,target_doc), headers = headers).json()
204
for namespace in res['namespaces']:
205
namespaces.append(namespace['namespace'])
206
if len(black_namespaces)>0: #블랙 네임이 있다면
207
for black_namespace in black_namespaces:
208
if black_namespace in namespaces:
209
namespaces.remove(black_namespace)
210
if len(namespaces)>0:
211
target_namespace = namespaces.pop(0)
212
else:
213
target_namespace = None
214
while target_namespace != None:
215
res = requests.get('https://{}/api/backlink/{}?namespace={}&from={}'.format(api_url,target_doc,target_namespace, backlink_value), headers = headers).json()
216
backlinks=res['backlinks']
217217
backlink_value=res['from']
218
for doc in res['backlinks']:
218
for doc in backlinks:
219219
white=False
220220
for white_doc in nontargets:
221221
if doc['document'] == white_doc:
......
226226
continue
227227
target_backlinks.append(doc['document'])
228228
if backlink_value==None:
229
break
229
if len(namespaces)>0:
230
target_namespace = namespaces.pop(0)
231
backlink_value=''
232
else:
233
break
230234
for doc in target_backlinks:
231235
try:
232236
res = requests.get('https://{}/api/edit/{}'.format(api_url,doc), headers = headers).json()
......
316320
json_data = {}
317321
for target, replace in targets:
318322
for doc in custom_list:
319
doc = doc+'Music'
320323
try:
321324
res = requests.get('https://{}/api/edit/{}'.format(api_url,doc), headers = headers).json()
322325
except:
......