niqdev / packtpub-crawler

Download your daily free Packt Publishing eBook https://www.packtpub.com/packt/offers/free-learning
MIT License
755 stars 178 forks source link

PR 27 changed behavior of extras path #57

Open juzim opened 7 years ago

juzim commented 7 years ago

I just saw that https://github.com/niqdev/packtpub-crawler/pull/27 changed the behavior of the path.extras value.

Before it was used on it's own equally to the download path: directory = self.__config.get('path', 'path.extras') now it's appended ` if self.__config.has_option('path', 'path.group'):

        folder_name = self.info['title'].encode('ascii', 'ignore').replace(' ', '_') + \
                      self.info['author'].encode('ascii', 'ignore').replace(' ', '_')

        directory = base_path + join(self.__config.get('path', 'path.ebooks'), folder_name,         self.__config.get('path', 'path.extras'))
    else:
        directory = base_path + self.__config.get('path', 'path.extras')`

@lszeremeta could you have a look? Since the extras be quite large, it should be possible to move them somewhere else.

Can you also add your changes to the example prod file and the readme? It took me quite some time to figure out what was happening.

Otherwise, if we decide which behavior we want to keep, I can refactor it while working on https://github.com/niqdev/packtpub-crawler/pull/56

niqdev commented 7 years ago

@juzim hi I can't test the new changes now..I'll merge the pr next week. Is it stable or require more changes? Thanks

juzim commented 7 years ago

I have closed the PR.

I was hoping that @lszeremeta might take a look himself because I don't have much time at the moment.

When we decide that we want the extras path independent from the download path, I will include the changes in my PR. I also need this for the long awaited download all functionality that willmight be done soon.