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

Alternative folder for repost images and -norepost command line argument #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

msk-nightingale
Copy link

No description provided.

Copy link
Owner

@dixudx dixudx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature. Thanks for your contribution.

target_folder_base = os.path.join(current_folder, site)
if not os.path.isdir(target_folder_base):
os.mkdir(target_folder_base)
target_folder_other = os.path.join(current_folder, site+'-other')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using the origin site name as the new folder name? And we could avoid downloading the duplicate photos/videos as well.

I mean if the media in A is reblogged from B, you can just create a new folder B to store this media, instead of current A-other.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not comfortable when threre ara many reposts from many different blogs and a user need to see lot of photos / videos...

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not comfortable when threre ara many reposts from many different blogs and a user need to see lot of photos / videos...

Still use A and B as an example.

A: media1
   media2 (rebloged from B)
B: media2 (rebloged from C)
   media3

What if a user is trying to downloading media2 from site A, you will save it to A-other folder. And later if downloading from site B, media2 will be downloaded again and save to B-other folder.

Actually they are identical, which should not be save multiple times.

Then why not directly saving it to folder C (for site C)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe... I made this feature for me and it's bad for me what you say.

@@ -201,6 +204,13 @@ def _download_media(self, site, medium_type, start):
data = xmltodict.parse(xml_cleaned)
posts = data["tumblr"]["posts"]["post"]
for post in posts:
if '@reblogged-from-url' in post:
target_folder=target_folder_other
if len (sys.argv) > 2 and sys.argv[2] == '-norepost':
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better add some help message on this new flag in the main function.

Update README as well please.

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

Successfully merging this pull request may close these issues.

None yet

2 participants