[BUG] idownloadcoupon scraper error
MohamedTechPro opened this issue · comments
Mohamed ❤️ Coding commented
Describe the bug
This is the error log.
Error while running idownloadcoupon scraper: list index out of range
Traceback (most recent call last):
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/base_scraper.py", line 90, in wrapper
response = await func(self)
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 36, in run
links = await self.get_links()
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 54, in get_links
udemy_links = await self.gather_udemy_course_links(course_links)
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 104, in gather_udemy_course_links
for link in await asyncio.gather(*map(self.get_udemy_course_link, courses))
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 93, in get_udemy_course_link
return cls.validate_coupon_url(urllib.parse.unquote(urls[1]))
IndexError: list index out of range
To Reproduce
Steps to reproduce the behavior:
- Clone the repo or install it from pypi.
- Install dependencies.
- cd to repo directory.
python run_enroller.py
- See error
Expected behavior
All scrapers works fine.
Desktop (please complete the following information):
- OS: Arch Linux
- Version 4.1.3
Md. Samin Irtiza commented
Hi,
I issued a fix. hope it helps :)
Mohamed ❤️ Coding commented
i got this error:
Error while running idownloadcoupon scraper: list index out of range
Traceback (most recent call last):
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/base_scraper.py", line 90, in wrapper
response = await func(self)
^^^^^^^^^^^^^^^^
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 36, in run
links = await self.get_links()
^^^^^^^^^^^^^^^^^^^^^^
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 54, in get_links
udemy_links = await self.gather_udemy_course_links(course_links)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 104, in gather_udemy_course_links
for link in await asyncio.gather(*map(self.get_udemy_course_link, courses))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/udemy_enroller/scrapers/idownloadcoupon.py", line 93, in get_udemy_course_link
return cls.validate_coupon_url(urllib.parse.unquote(urls[1]))
~~~~^^^
Md. Samin Irtiza commented
My PR hasn't been accepted yet. you are using old code. so you're getting the same error. if you want to test my code go to the PR and use that version at your own risk I should add.
Hussnain Amjad commented
@samin-irtiza your code worked perfectly. Thanks