mjbright / futurelearn-dl

A script to download materials from the FutureLearn website (for enrolled courses)
GNU General Public License v3.0
34 stars 20 forks source link

[SOLVED] Download dies with 'FATAL:No quote(char=\) in <<t;<a href=\"/profile...>>' #9

Closed zenny closed 4 years ago

zenny commented 6 years ago

Retrieval dies with 'Unhandled escape sequence in filename'

$ futurelearn-dl.py EMAIL PASSWORD diabetes-genomic-medicine 14
...
Downloading 4-week course 'diabetes-genomic-medicine'
Downloading url<https://ugc.futurelearn.com/uploads/files/86/fc/86fc7901-2955-4735-a9ed-ca82fd83fd45/Glossary_16.05.16.pdf>
    to file <diabetes-genomic-medicine/week1/1.1-Welcome-and-introduction-to-the-course_Glossary_16.05.16.pdf> ...
type=pdf, content.len=346813
Downloading url<https://ugc.futurelearn.com/uploads/files/e7/51/e7510d14-13cf-4d05-b2d0-c10585c67db5/Resources.pdf>
    to file <diabetes-genomic-medicine/week1/1.1-Welcome-and-introduction-to-the-course_Resources.pdf> ...
type=pdf, content.len=289436
Downloading url<https://view.vzaar.com/5894540/video>
    to file <diabetes-genomic-medicine/week1/1.2-&quot;It&#39;s-changed-our-lives&quot;_5894540.mp4> ...
type=mp4, content.len=5417214
Downloading url<https://view.vzaar.com/6187238/video>
    to file <diabetes-genomic-medicine/week1/1.5-Understanding-the-pathophysiology_6187238.mp4> ...
type=mp4, content.len=4337309
Downloading url<https://view.vzaar.com/6181836/video>
    to file <diabetes-genomic-medicine/week1/1.8-The-biggest-change-for-us_6181836.mp4> ...
type=mp4, content.len=3585832
Downloading url<https://view.vzaar.com/6069128/video>
    to file <diabetes-genomic-medicine/week1/1.9-What-is-the-impact-for-clinicians_6069128.mp4> ...
type=mp4, content.len=18589056
Downloading url<http://www.diabetesatlas.org/resources/2015-atlas.html>
    to file <diabetes-genomic-medicine/week1/1.10-What-is-the-prevalence-of-diabetes_2015-atlas.html> ...
downloadURLToFile: Failed to download url <http://www.diabetesatlas.org/resources/2015-atlas.html> => 404
Downloading url<https://diabetes-resources-production.s3-eu-west-1.amazonaws.com/diabetes-storage/migration/pdf/DiabetesUK_Facts_Stats_Oct16.pdf>
    to file <diabetes-genomic-medicine/week1/1.12-How-does-a-family-history-affect-my-risk-of-diabetes_DiabetesUK_Facts_Stats_Oct16.pdf> ...
type=pdf, content.len=568295
Downloading url<https://view.vzaar.com/5952300/video>
    to file <diabetes-genomic-medicine/week1/1.13-Sharing-stories_5952300.mp4> ...
type=mp4, content.len=31911949
Downloading url<https://view.vzaar.com/5984535/video>
    to file <diabetes-genomic-medicine/week2/2.3-What-genomics-can-teach-us-about-polygenic-diabetes_5984535.mp4> ...
type=mp4, content.len=37612216
Downloading url<http://www.nature.com/nrg/journal/v6/n3/abs/nrg1556.html>
    to file <diabetes-genomic-medicine/week2/2.4-The-obesity-epidemic_nrg1556.html> ...
type=html, content.len=493548
Downloading url<http://care.diabetesjournals.org/content/early/2015/10/30/dc15-1111.full.pdf>
    to file <diabetes-genomic-medicine/week2/2.6-What-can-we-learn-from-polygenics_dc15-1111.full.pdf> ...
type=pdf, content.len=1098042
Downloading url<https://view.vzaar.com/5943210/video>
    to file <diabetes-genomic-medicine/week2/2.9-C-peptide_5943210.mp4> ...
type=mp4, content.len=3445916
Downloading url<https://view.vzaar.com/5953006/video>
    to file <diabetes-genomic-medicine/week2/2.11-Family-Trees_5953006.mp4> ...
type=mp4, content.len=7580428
Downloading url<https://view.vzaar.com/6134563/video>
    to file <diabetes-genomic-medicine/week3/3.2-Dan’s-story_6134563.mp4> ...
type=mp4, content.len=6563552
Downloading url<https://view.vzaar.com/6134585/video>
    to file <diabetes-genomic-medicine/week3/3.4-Misdiagnosis_6134585.mp4> ...
type=mp4, content.len=12608396
Downloading url<http://www.nature.com/nrneph/journal/v11/n2/full/nrneph.2014.232.html>
    to file <diabetes-genomic-medicine/week3/3.5-Further-reading-on-the-different-MODY-subtypes_nrneph.2014.232.html> ...
type=html, content.len=290881
FATAL:downloadURLInPage: Unhandled escape sequence in filename <3.5-Further-reading-on-the-different-MODY-subtypes_PIIS0140-6736%2803%2914571-0.pdf>

Same with: digital-cancer-management run 1 which died with 'FATAL:No quote(char=) in <<t;<a href=\"/profile...>>' as of below:

$ ./futurelearn-dl.py EMAIL PASSWORD digital-cancer-management 1
Downloading 4-week course 'digital-cancer-management'
Downloading url<https://view.vzaar.com/12215674/video>
    to file <digital-cancer-management/week1/1.1-Course-introduction_12215674.mp4> ...
type=mp4, content.len=55341081
Downloading url<https://view.vzaar.com/12148582/video>
    to file <digital-cancer-management/week1/1.4-Showcase-of-Digital-Health-Technologies_12148582.mp4> ...
type=mp4, content.len=46315912
Downloading url<https://view.vzaar.com/12177169/video>
    to file <digital-cancer-management/week1/1.5-Patient-advocacy:-working-with-and-for-the-patient_12177169.mp4> ...
type=mp4, content.len=38991678
Downloading url<https://view.vzaar.com/12177170/video>
    to file <digital-cancer-management/week1/1.6-Patient-involvement-makes-a-better-healthcare-technology-ecosystem-_12177170.mp4> ...
type=mp4, content.len=17914038
Downloading url<https://view.vzaar.com/12201211/video>
    to file <digital-cancer-management/week2/2.1-Mind-body-connections_12201211.mp4> ...
type=mp4, content.len=26357533
Downloading url<https://view.vzaar.com/12213553/video>
    to file <digital-cancer-management/week2/2.3-Sleep,-rest,-eat-well-and-reduce-stress_12213553.mp4> ...
type=mp4, content.len=19372637
FATAL:No quote(char=\) in <<t;<a href=\"/profile...>>

Thanks for the wonderful tool, @mjbright. Season's greetings!

GiammaCarioca commented 6 years ago

I'm getting the same error

mjbright commented 6 years ago

Hi folks, sorry for the late reply. Thanks for reporting the issues but I'm afraid I won't have time to fix this anytime soon. I'll try to have a look sometime. Feel free to provide more examples, so that I have an ongoing FutureLearn course to try when I do get around to having a look (I need to study a bit on unicode handling first).

On 16 April 2018 at 04:39, GiammaCarioca notifications@github.com wrote:

I'm getting the same error

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mjbright/futurelearn-dl/issues/9#issuecomment-381464147, or mute the thread https://github.com/notifications/unsubscribe-auth/ABywLWKZGMMmUda-heAtP6vXtrBn7f4lks5tpARsgaJpZM4RFWFu .

simincai1996 commented 6 years ago

try to change in futurelearn-dl.py 341 line: if quote == " " and quote == ' ':

yytsui commented 6 years ago

@simincai1996 Thanks, that works for me! maybe you can make a pull request?

zenny commented 5 years ago

@simincai1996 Thanks for https://github.com/mjbright/futurelearn-dl/issues/9#issuecomment-383310517

Yet, I continue getting:

$ ./TEST_futurelearn-dl.py.sh
  File "./futurelearn-dl.py", line 341
    if quote == " " and quote == ' ':
                                    ^
TabError: inconsistent use of tabs and spaces in indentation

However, I pulled @yytsui https://github.com/yytsui/futurelearn-dl repo and it started working, fyi. Thanks to @yytsui @simincai1996 and @mjbright for making life incredibly easier.