mirror of
https://github.com/Relintai/ytdl_link_gen.git
synced 2024-11-14 04:47:18 +01:00
Wait a bit between two channel udpates.
This commit is contained in:
parent
d829af3d7c
commit
0c6cfd452a
@ -18,6 +18,8 @@ import sys
|
|||||||
import datetime
|
import datetime
|
||||||
import shutil
|
import shutil
|
||||||
import gc
|
import gc
|
||||||
|
import time
|
||||||
|
import random
|
||||||
|
|
||||||
config_data = []
|
config_data = []
|
||||||
video_file_data = {}
|
video_file_data = {}
|
||||||
@ -29,6 +31,9 @@ def print_usage():
|
|||||||
print("gen : generates video download shell script");
|
print("gen : generates video download shell script");
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
def sleep_range(min_sleep, rand_add):
|
||||||
|
time.sleep(random.random() * float(rand_add) + float(min_sleep))
|
||||||
|
|
||||||
def copy(src, dest):
|
def copy(src, dest):
|
||||||
try:
|
try:
|
||||||
shutil.copytree(src, dest)
|
shutil.copytree(src, dest)
|
||||||
@ -838,3 +843,6 @@ if command == "gen":
|
|||||||
|
|
||||||
collected = gc.collect()
|
collected = gc.collect()
|
||||||
print("Garbage collector: collected", "%d objects." % collected)
|
print("Garbage collector: collected", "%d objects." % collected)
|
||||||
|
|
||||||
|
# TODO make this customizable from the commadn line
|
||||||
|
sleep_range(10, 5)
|
||||||
|
Loading…
Reference in New Issue
Block a user