ankitsejwal / Lyndor

:rocket: Powerful command line tool to download lynda.com courses for personal offline use. :part_alternation_mark:
MIT License
131 stars 32 forks source link

On Windows machines with Non-english locales, files with special characters in their name aren't being moved #25

Open TFWol opened 6 years ago

TFWol commented 6 years ago

Files with dashes in their name aren't being moved since the dashes, and possibly other characters, are being removed from the file names themselves causing a mismatch.

Ex: Error: File not found: 18 - An Example—Infrastructure.mp4 Filename in folder: 18 - An ExampleInfrastructure.mp4

Affected Courses:

TFWol commented 6 years ago

I'm thinking instead of stripping out characters based on regex, we should have the save.py somehow store the names of the downloaded files into a list where move.py can match and move accordingly. Just an idea, I'd have to do some reading to know where to start or if it's even worth the time though.

ankitsejwal commented 6 years ago

I'm not able to reproduce this error on MacOS either with python 2.x or 3.x It may be a windows thing, I'll test it on windows soon. Thanks for reporting it mate.

anilgunesh commented 6 years ago

I think this bug is also related to courses where the Author has a name/surname with special characters.

I am giving one example here: [https://www.lynda.com/Career-Development-tutorials/Repairing-Your-Reputation/441832-2.html]

Traceback (most recent call last): File "C:\Lyndor-master/run.py", line 127, in main() File "C:\Lyndor-master/run.py", line 33, in main schedule_download(url) File "C:\Lyndor-master/run.py", line 49, in schedule_download download_course(url) File "C:\Lyndor-master/run.py", line 92, in download_course save.info_file(url, course_folder_path) # Gather information File "C:\Lyndor-master\save.py", line 106, in info_file message.write("Author Name", author_name) File "C:\Lyndor-master\message.py", line 43, in write sys.stdout.write(str(description) + '\t' + str(value) + '\n') UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 10: ordinal not in range(128)

ankitsejwal commented 6 years ago

Thanks for reporting it @anilgunesh. It should be fixed now, have a look. Cheers.

anilgunesh commented 6 years ago

Many thanks for the quick fix. I can confirm that it works fine now. regards a.

On Tue, 5 Jun 2018 at 15:09, ankit sejwal notifications@github.com wrote:

Thanks for reporting it @anilgunesh https://github.com/anilgunesh. It should be fixed now, have a look. Cheers.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ankitsejwal/Lyndor/issues/25#issuecomment-394723407, or mute the thread https://github.com/notifications/unsubscribe-auth/AMzJVBnmVsTtMc1hzfHT9NaI-kohj7Qfks5t5pEqgaJpZM4TNqmb .

--


Anil Gunesh

TFWol commented 6 years ago

Sorry I've been extremely busy, I can at least make a comment here and there. Just reporting for awareness my particular issue still persists.

ankitsejwal commented 6 years ago

sorry mate, I am not able to reproduce this bug as I don't have an access to a windows laptop. I'll test it a soon as possible.