Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving url query string in filename #29

Open
ghost opened this issue Sep 10, 2017 · 1 comment
Open

Saving url query string in filename #29

ghost opened this issue Sep 10, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 10, 2017

Currently if you try to save a resource with the template of:

www.site.com/news?385

It will save it as merely "news" instead of something like news@385 (like what wget does).

I looked through the code and couldn't find the part that is handling the url query, but if one is saving a large amounts of files in that format, it becomes less userfriendly to simply have a thousand files labeled "news".

Awesome program by the way.

@jsvine
Copy link
Owner

jsvine commented Sep 12, 2017

Thanks! And that's a great point. I'm leaning toward shifting waybackpack's away from filesystem storage and toward database storage. (Relevant comment here.) With the latter, there would be no need to convert URLs into filepaths.

Re. the code, the relevant bit is this line, which uses Python's built-in os.path.split and urlparse methods to extract the filename: https://github.com/jsvine/waybackpack/blob/master/waybackpack/pack.py#L42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant