gautamdhameja / medium-2-md

A CLI tool that converts exported Medium posts (html) to Jekyll/Hugo compatible markdown with front matter.
https://www.npmjs.com/package/medium-2-md
Apache License 2.0
144 stars 19 forks source link

Error converting file when using --images parameter (for stories under publications) #18

Closed mmBs closed 3 years ago

mmBs commented 3 years ago

Hi, first of all, thanks for this cool tool 👍

When I try to convert with the command:

medium-2-md convertLocal posts/ -i this story: Lucky 7 new tools and plugins for Android developers & designers

I got only

Error converting file: 2018-09-25_Lucky-7-new-tools-and-plugins-for-Android-developers---designers-1545e5c59f27.html. Skipping.

What is interesting, my story 50 Android Studio Tips, Tricks & Resources you should be familiar with, as an Android Developer is successfully converted with all images and gifs.

Completed: 2016-11-07_50-Android-Studio-Tips--Tricks---Resources-you-should-be-familiar-with--as-an-Android-Developer-af86e7cf56d2.md

The only difference I noticed is that tips and tricks are not under any publication, however other stories are.

Please let me know where could be a problem.

Cheers 🍻

bdfinst commented 3 years ago

I saw similar behavior and submitted a PR that may address it for you.

mmBs commented 3 years ago

Hi @bdfinst. Thank you for the PR. I downloaded the last version from npm (https://www.npmjs.com/package/medium-2-md) but I get the same issue. Error converting file: 2018-09-25_Lucky-7-new-tools-and-plugins-for-Android-developers---designers-1545e5c59f27.html. Skipping.

I also noticed, that all gifs / pngs are in temp folders, like md_1606903525016, so I believe this is somehow good behaviour.

bdfinst commented 3 years ago

Hi @bdfinst. Thank you for the PR. I downloaded the last version from npm (https://www.npmjs.com/package/medium-2-md) but I get the same issue. Error converting file: 2018-09-25_Lucky-7-new-tools-and-plugins-for-Android-developers---designers-1545e5c59f27.html. Skipping.

I also noticed, that all gifs / pngs are in temp folders, like md_1606903525016, so I believe this is somehow good behaviour.

The issue I fixed was related to metadata being in the wrong array position and causing an undefined property. This may help you track it down. https://github.com/gautamdhameja/medium-2-md/pull/19/files

epelaaez commented 3 years ago

I'm getting the same error where images are not being generated. Something interesting is that it works for one out of four posts I want to convert, all of which are published under a publication. I'm using the latest download, is there a solution yet for this problem? If so, what do I need to do?

gautamdhameja commented 3 years ago

@epelaaez Can you point to which Medium post you are getting an error with? I'll test it out. Better, if you could just share the downloaded HTML file (Pastebin). I am unable to reproduce the error at my end with the data I have.

epelaaez commented 3 years ago

Sure, I'll attach the three posts I'm having problems with here. The one that converts successfully is the Vectors and Scalars one, the other three show errors.

posts.zip

Thanks for your help.

gautamdhameja commented 3 years ago

@epelaaez I was able to convert all the files that you shared just by using the latest version of the lib. Attaching below. Not sure what is causing the issue at your side. A couple of these files took a bit longer though.

md_1618943195474.zip

epelaaez commented 3 years ago

Thanks, I will look into it.

gautamdhameja commented 3 years ago

Closing as no repro.