Udemy-dl: Unable to extract login-form form TypeError: expected string or buffer

Created on 22 Feb 2018  路  4Comments  路  Source: r0oth3x49/udemy-dl

Hello. I always get this problem\error
inkedinkedudemy-dl_li
I've tried everything. Installing all the packages one by one, all together, updating python, using python2 but nothing works.
What can I do? Thanks

Most helpful comment

i will fix this ASAP. BTW i 'm facing the same problem too :stuck_out_tongue_winking_eye: :joy:

Update
Added a quick fix let me know if this worked for all of you as well. have a look working for me on py2,py3 both.
screen shot 2018-02-22 at 11 15 25 pm
screen shot 2018-02-22 at 11 16 37 pm

All 4 comments

same from #125

Although many duplicates can be found in issues, none of the solutions there worked for me.
Using Python 3.6.4 on Windows 8.1, elevated CMD, tried Python2 as well, every requirement re-installed/upgraded as well, none works out.

I debugged the extractor myself and found out that html (when expected otherwise) returns a robot check/captcha page, thus resulting in regex compiler returning an error, not finding the expected. Prettified output file for html string as follows:
output.zip

Tried every solution, upgrading packages, updating to latest Python 3,6.4, none of them worked.

C:\Users\ACER\Downloads\Compressed\udemy-dl-master\udemy-dl-master>python udemy-dl.py -u **@*.com -p *** https://www.udemy.com/instagram-marketing-for-small-businesses/

          __                               ____

__ ______/ /__ ____ ___ __ __ ____/ / /
/ / / / __ / _ \/ __ `__ \/ / / /_____/ __ / /
/ /_/ / /_/ / __/ / / / / / /_/ /_____/ /_/ / /
__,_/__,_/___/_/ /_/ /_/__, / __,_/_/
/____/
Version : 0.3
Author : Nasir khan(r0ot h3x49)
Visit : https://github.com/r0oth3x49

[] : Downloading webpage..
[
] : Extracting course information..
[] : Downloading 'instagram marketing for small businesses'.
[
] : Trying to login as (***@com)...
[-] Unable to extract login-form form
Traceback (most recent call last):
File "udemy-dl.py", line 936, in
main()
File "udemy-dl.py", line 841, in main
udemy.ExtractAndDownload()
File "udemy-dl.py", line 303, in ExtractAndDownload
self.login()
File "udemy-dl.py", line 40, in login
extract_info.login(self.username, self.password)
File "C:\Users\ACER\Downloads\Compressed\udemy-dl-master\udemy-dl-master\udemy_extractor.py", line 147, in login
login_form = self._fill_login_form(login_popup, username, password)
File "C:\Users\ACER\Downloads\Compressed\udemy-dl-master\udemy-dl-master\udemy_extractor.py", line 98, in _fill_login_form
login_form = self._form_hidden_inputs('login-form', webpage)
File "C:\Users\ACER\Downloads\Compressed\udemy-dl-master\udemy-dl-master\udemy_extractor.py", line 88, in _form_hidden_inputs
return _hidden_inputs(form)
File "C:\Users\ACER\Downloads\Compressed\udemy-dl-master\udemy-dl-master\udemy_utils.py", line 80, in _hidden_inputs
html = re.sub(r'', '', html)
File "C:\Users\ACER\AppData\Local\Programs\Python\Python36-32\lib\re.py", line 191, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object

C:\Users\ACER\Downloads\Compressed\udemy-dl-master\udemy-dl-master>

i will fix this ASAP. BTW i 'm facing the same problem too :stuck_out_tongue_winking_eye: :joy:

Update
Added a quick fix let me know if this worked for all of you as well. have a look working for me on py2,py3 both.
screen shot 2018-02-22 at 11 15 25 pm
screen shot 2018-02-22 at 11 16 37 pm

Was this page helpful?
0 / 5 - 0 ratings