EltonChou / TwitterMediaHarvest

Download twitter media with only one-click.
https://chrome.google.com/webstore/detail/media-harvest-twitter-med/hpcgabhdlnapolkkjpejieegfpehfdok
MIT License
427 stars 36 forks source link

[FEATURE] An Option to have the Tweet in the filename #124

Closed G1732 closed 10 months ago

G1732 commented 10 months ago

Any way to have the tweet content in the filename.

EltonChou commented 10 months ago

Filename is not a notepad.

G1732 commented 10 months ago

Filename is not a notepad.

Yes i know but it could be useful to have this option because some tweets have names of the people and some have important text that should in the filename. This also helps to keep the downloaded files organized.

Btw, i just want the extension to save upto 30 letters of the tweet.That would be enough for me.

Example of tweets: bH5f1NKnQ0 1Vu5AQFHby

EltonChou commented 10 months ago

There are few things need to be solved.

  1. How do you define the important text ?
  2. The max length of tweet is 280 characters, if you paid you get more. Where is the important part?

If the content has hashtags, it would be recorded in database and you can search the tags in options page. This feature would be release in the future.

G1732 commented 10 months ago

There are few things need to be solved.

  1. How do you define the important text ?
  2. The max length of tweet is 280 characters, if you paid you get more. Where is the important part?

If the content has hashtags, it would be recorded in database and you can search the tags in options page. This feature would be release in the future.

  1. There is no need to define the important text because that would be impossible, the extension should simply save the tweet text content in the filename. For example the photo of the owl in my post above should have the filename as :

"Barn Owl (photo by Michal Ninger).jpg" .

This helps in keeping downloaded files organized.

  1. Upto 280 characters is more than enough, if it can save 50 characters of a tweet in the filename thats more than enough for me.
EltonChou commented 10 months ago

You didn't get the point. This is your scenario not everyone's.

How do you handle three different formats below?

BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruh
Barn Owl (photo by Michal Ninger)
FoobarFoobarFoobarFoobarFoobar
FoobarFoobarFoobarFoobarFoobar
Barn Owl (photo by Michal Ninger)
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruh
FoobarFoobarFoobarFoobarFoobar
FoobarFoobarFoobarFoobarFoobar
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruh
FoobarFoobarFoobarFoobarFoobar
FoobarFoobarFoobarFoobarFoobar
Barn Owl (photo by Michal Ninger)

The most of operating systems restrict the length of filename length to less or equal to 255 characters. What if the content length is over 255? Remember that you have to keep the filename as unique, so you still need other filename patterns.

G1732 commented 10 months ago

You didn't get the point. This is your scenario not everyone's.

How do you handle three different formats below?

BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruh
Barn Owl (photo by Michal Ninger)
FoobarFoobarFoobarFoobarFoobar
FoobarFoobarFoobarFoobarFoobar
Barn Owl (photo by Michal Ninger)
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruh
FoobarFoobarFoobarFoobarFoobar
FoobarFoobarFoobarFoobarFoobar
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruhBruhBruh
BruhBruhBruhBruhBruh
FoobarFoobarFoobarFoobarFoobar
FoobarFoobarFoobarFoobarFoobar
Barn Owl (photo by Michal Ninger)

The most of operating systems restrict the length of filename length to less or equal to 255 characters. What if the content length is over 255? Remember that you have to keep the filename as unique, so you still need other filename patterns.

I would save the three formats as they are because they contain the important text "Barn Owl (photo by Michal Ninger)."

As for the character length of the filename, if it is over 255 characters then the extension should save upto 255 and ignore the rest of the characters.

And in order to keep the filename unique i would use "Tweet ID" or "Hash" options in Filename Pattern.

EltonChou commented 10 months ago

As for the character length of the filename, if it is over 255 characters then the extension should save upto 255 and ignore the rest of the characters.

If the important text is located at somewhere > 255 characters, how do you handle it? Your filename will be {tweet id}-{hash}-{a lot of text without important text}.{ext}.

G1732 commented 10 months ago

As for the character length of the filename, if it is over 255 characters then the extension should save upto 255 and ignore the rest of the characters.

If the important text is located at somewhere > 255 characters, how do you handle it? Your filename will be {tweet id}-{hash}-{a lot of text without important text}.{ext}.

If some filenames are saved without the important text, its okay.

EltonChou commented 10 months ago

Then those texts are not important. If you want this feature you can fork it and implement by yourself.

G1732 commented 10 months ago

Then those texts are not important. If you want this feature you can fork it and implement by yourself.

Well, Okay.

Atleast give your suggestion on how you would have solved this.

EltonChou commented 10 months ago

I will provide a regex token for advanced user in the future, but the user needs to know how to write a valid regular expression.

G1732 commented 10 months ago

I will provide a regex token for advanced user in the future, but the user needs to know how to write a valid regular expression.

Sorry i am a bit confused can you please elaborate.

Using regex how will a user save the important text in this tweet.

BruhBruhBruhBruhBruhBruhBruh BruhBruhBruhBruhBruhBruhBruh BruhBruhBruhBruhBruh Barn Owl (photo by Michal Ninger) FoobarFoobarFoobarFoobarFoobar FoobarFoobarFoobarFoobarFoobar

I just want to know.

EltonChou commented 10 months ago

Something like /^.+\(\w+ by .+\)/gm.

G1732 commented 10 months ago

One last thing, what will be the regex for this tweet :

image

EltonChou commented 10 months ago

You should try it by yourself. https://regex101.com/