Merge branch 'develop' of https://github.com/elebumm/RedditVideoMakerBot into dev
This commit is contained in:
commit
8e19b9fb9a
3 files changed
+11
-3
No files matched your search
@@ -1,6 +1,7 @@
|
||||
FROM python:3.10.9-slim
|
||||
|
||||
RUN apt update
|
||||
RUN apt-get install -y ffmpeg
|
||||
RUN apt install python3-pip -y
|
||||
|
||||
RUN mkdir /app
|
||||
|
||||
@@ -80,4 +80,4 @@ def ffmpeg_install():
|
||||
except Exception as e:
|
||||
print("Welcome fellow traveler! You're one of the few who have made it this far. We have no idea how you got at this error, but we're glad you're here. Please report this error to the developer, and we'll try to fix it as soon as possible. Thank you for your patience!")
|
||||
print(e)
|
||||
return None
|
||||
return None
|
||||
@@ -45,7 +45,14 @@ def get_start_and_end_times(video_length: int, length_of_clip: int) -> Tuple[int
|
||||
Returns:
|
||||
tuple[int,int]: Start and end time of the randomized interval
|
||||
"""
|
||||
random_time = randrange(180, int(length_of_clip) - int(video_length))
|
||||
initialValue = 180
|
||||
# Issue #1649 - Ensures that will be a valid interval in the video
|
||||
while(int(length_of_clip) <= int(video_length+initialValue)):
|
||||
if(initialValue == initialValue //2):
|
||||
raise Exception("Your background is too short for this video length")
|
||||
else:
|
||||
initialValue //= 2 #Divides the initial value by 2 until reach 0
|
||||
random_time = randrange(initialValue, int(length_of_clip) - int(video_length))
|
||||
return random_time, random_time + video_length
|
||||
|
||||
|
||||
@@ -155,4 +162,4 @@ def chop_background(
|
||||
return background_config["video"][2]
|
||||
|
||||
# Create a tuple for downloads background (background_audio_options, background_video_options)
|
||||
background_options = load_background_options()
|
||||
background_options = load_background_options()
|
||||
Reference in new issue
Block a user