r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.83k stars 1.19k forks source link

NOT an issue, but a small improvement #598

Closed iahim closed 3 years ago

iahim commented 3 years ago

Sometimes UDEMY can mark your connection as a bot (if you download too much/too fast). In the udemy-dl.py i have done this to put some delays between downloads:

import time, random

Then : ` def download_lecture(self, lecture, filepath, current, total, quality):

    """This function will simply download the lectures.."""

    rndInt = random.randint(5, 10)

    logger.info(msg="Sleep for {} sec".format(rndInt), new_line=True, before=True)

    time.sleep(rndInt)

`

r0oth3x49 commented 3 years ago

this seems a good idea though the download is sequential one after another, so it has i guess enough seconds to download the next video but i will check if this is needed.

iahim commented 3 years ago

It has happened to me before that Udemy blocked my download due to "bot detection". To solve it i have used a delay. I used before the youtube-dl. Again - amazing work with this project !