forked from rDrama/rDrama
rclone should be inside a gevent to prevent db transaction timeout
parent
b8be8dcebd
commit
89d11fdb2d
|
@ -196,7 +196,7 @@ def process_video(file, v):
|
||||||
gevent.spawn(delete_file, new, f'https://videos.{SITE}' + new.split('/videos')[1])
|
gevent.spawn(delete_file, new, f'https://videos.{SITE}' + new.split('/videos')[1])
|
||||||
|
|
||||||
if SITE == 'watchpeopledie.tv':
|
if SITE == 'watchpeopledie.tv':
|
||||||
rclone.copy(new, 'no:/videos', ignore_existing=True)
|
gevent.spawn(send_file, new)
|
||||||
return f'https://videos.{SITE}' + new.split('/videos')[1]
|
return f'https://videos.{SITE}' + new.split('/videos')[1]
|
||||||
else:
|
else:
|
||||||
return f"{SITE_FULL}{new}"
|
return f"{SITE_FULL}{new}"
|
||||||
|
@ -296,3 +296,6 @@ def delete_file(filename, url):
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
purge_files_in_cloudflare_cache(url)
|
purge_files_in_cloudflare_cache(url)
|
||||||
|
|
||||||
|
def send_file(filename):
|
||||||
|
rclone.copy(filename, 'no:/videos', ignore_existing=True)
|
||||||
|
|
Loading…
Reference in New Issue