Skip to content

Error: empty range for randrange()  #1649

Closed

Description

@amschuster

Error: empty range for randrange()

╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Sorry, something went wrong with this version! Try again, and feel free to report this issue at GitHub or the │
│ Discord community. │
│ Version: 3.1 │
│ Error: empty range for randrange() (180, -12, -192) │
│ Config: {'allow_nsfw': False, 'theme': 'dark', 'times_to_run': 1, 'opacity': 0.9, 'transition': 0.2, 'storymode': │
│ False, 'storymodemethod': 1, 'storymode_max_length': 1000, 'resolution_w': 1080, 'resolution_h': 1920, │
│ 'background': {'background_choice': 'minecraft', 'background_thumbnail': False, 'background_thumbnail_font_family': │
│ 'arial', 'background_thumbnail_font_size': 96, 'background_thumbnail_font_color': '255,255,255'}, 'tts': │
│ {'voice_choice': 'tiktok', 'aws_polly_voice': 'Matthew', 'streamlabs_polly_voice': 'Matthew', 'tiktok_voice': │
│ 'en_us_001', 'tiktok_sessionid': 'REDACTED', 'python_voice': '1', 'py_voice_num': '2', 'silence_duration': 0.3, │
│ 'no_emojis': False}} │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Traceback (most recent call last):
File "/Users/alexandraschuster/Downloads/RedditVideoMakerBot-master 7/main.py", line 130, in
raise err
File "/Users/alexandraschuster/Downloads/RedditVideoMakerBot-master 7/main.py", line 111, in
run_many(config["settings"]["times_to_run"])
File "/Users/alexandraschuster/Downloads/RedditVideoMakerBot-master 7/main.py", line 64, in run_many
main()
File "/Users/alexandraschuster/Downloads/RedditVideoMakerBot-master 7/main.py", line 55, in main
chop_background_video(bg_config, length, reddit_object)
File "/Users/alexandraschuster/Downloads/RedditVideoMakerBot-master 7/video_creation/background.py", line 96, in chop_background_video
start_time, end_time = get_start_and_end_times(video_length, background.duration)
File "/Users/alexandraschuster/Downloads/RedditVideoMakerBot-master 7/video_creation/background.py", line 41, in get_start_and_end_times
random_time = randrange(180, int(length_of_clip) - int(video_length))
File "/Users/alexandraschuster/anaconda3/lib/python3.10/random.py", line 353, in randrange
raise ValueError("empty range for randrange() (%d, %d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (180, -12, -192)

Reproduction Steps

I tried to run the bot

Expected behavior

I expected the bot to run and received this error.

Screenshots

No response

System Information

Operating System : Apple
Python version : 3.10.9
App version / Branch : 3.1

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.

Additional Context

No response

Activity

  1. added
    bug
    on May 19, 2023
  2. changed the title [-][Bug]: [/-] [+] Error: empty range for randrange() [/+] on May 19, 2023
  3. github-actions commented on May 26, 2023

    @github-actions
    Contributor

    This issue is stale because it has been open 7 days with no activity. Remove stale label or comment, or this will be closed in 10 days.

  4. added a commit that references this issue on May 26, 2023
    fcf6ef9
  5. propilideno commented on May 26, 2023

    @propilideno
    Contributor

    Hey bro, i've had this error before , i fixed it for you.

  6. added a commit that references this issue on May 26, 2023
    91c607a
  7. added a commit that references this issue on Apr 5, 2026
    410810e
  8. added 2 commits that reference this issue on Oct 23, 2026
    7aa56f4
    2af522c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions