fds
This commit is contained in:
parent
2f52ff082e
commit
5ff5664548
1 changed files with 21 additions and 0 deletions
|
@ -23,6 +23,27 @@ GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
|
||||||
|
|
||||||
month = datetime.now().strftime('%B')
|
month = datetime.now().strftime('%B')
|
||||||
|
|
||||||
|
|
||||||
|
@app.get('/fix')
|
||||||
|
@admin_level_required(3)
|
||||||
|
def fix(v):
|
||||||
|
li = g.db.query(Submission).filter(Submission.url.like('https://i.ibb.co/%.webp'), Submission.id < 17000).order_by(Submission.id).all()
|
||||||
|
num = request.values.get('num')
|
||||||
|
if num: li = li[:int(num)]
|
||||||
|
for post in li:
|
||||||
|
print(post.id, flush=True)
|
||||||
|
try: req = requests.get(f"https://web.archive.org/{post.url}", timeout=10)
|
||||||
|
except: continue
|
||||||
|
if str(req) == '<Response [200]>':
|
||||||
|
print(post.url, flush=True)
|
||||||
|
post.url = req.url.replace('/https://i.ibb.co/','if_/https://i.ibb.co/')
|
||||||
|
post.thumburl = post.url
|
||||||
|
print(post.permalink, flush=True)
|
||||||
|
g.db.add(post)
|
||||||
|
g.db.commit()
|
||||||
|
print('its over', flush=True)
|
||||||
|
return 'sex'
|
||||||
|
|
||||||
@app.post('/admin/merge/<id1>/<id2>')
|
@app.post('/admin/merge/<id1>/<id2>')
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
def merge(v, id1, id2):
|
def merge(v, id1, id2):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue