ViciousPotato / safaribooks

Convert safaribooksonline ebook to epub and Kindle mobi format
350 stars 78 forks source link

invalid choice #41

Open caozilu opened 6 years ago

caozilu commented 6 years ago

safaribooks: error: invalid choice: "sessionid=xxxxxxxxxxxxxxxxxxxxxx;'" (choose from 'download-epub', 'download', 'convert-to-mobi')

my input: safaribooks -o 'C:\Users\xxx\Downloads\' -c 'BrowserCookie=xxxxxxxxxxxxxxxxxxxxxxxxx; sessionid=xxxxxxxxxxxxxx;' -b 9781118026694 download

yoko1998 commented 6 years ago

It seems despite what instruction says you have to use double quotes instead of single quotes or remove space before sessionid. However this anyway leads to next error, trying to understand what the issue is. File "c:\users\qqq\appdata\local\programs\python\python36-32\lib\site-packages\safaribooks\spiders\safaribooks.py", line 91, in parse cookies = dict(x.strip().split('=') for x in self.cookie.split(';')) ValueError: dictionary update sequence element #2 has length 1; 2 is required

yoko1998 commented 6 years ago

Well if you remove last ; it will pass that second problem and you will be able to go.

However, next thing it tries to navigate to TOC page which URL seems to be changed on safari since this parser was previousely written. (See issue #49 )