mittya / media-helper

Easily download Instagram pictures and ~videos~ (Browser extensions)
MIT License
80 stars 14 forks source link

Fetching incorrect usernames #83

Closed frozenpandaman closed 9 months ago

frozenpandaman commented 1 year ago

When I click to download photos, they download as _000_000_n.jpg instead of username_000_000_n.jpg.

Using ver. 1.27.4.

mittya commented 1 year ago

Hi, wait and try version 1.27.5. I have tested it and it works fine for me.

82

frozenpandaman commented 1 year ago

@mittya Thanks for the fast response! Hmm, it's actually getting the wrong person's username for me now… seems to be pulling the name from the person1 and 100 others liked this string – not the uploader.

Leimy84 commented 1 year ago

I fixed it for me by changing the "findMedia"-Function in "script.js"

articles = _parent.parents('article').concat(_parent.parents('main'));
//if (articles[0].querySelector('.x1lliihq a[role="link"].notranslate')) {
// _username = articles[0].querySelector('.x1lliihq a[role="link"].notranslate').text;
//}
//else if (articles[0].querySelector('._aaqt a[role="link"]')) {
// _username = articles[0].querySelector('._aaqt a[role="link"]');
//}
if (articles[0].querySelector('._aaqt a[role="link"]')) {_username = articles[0].querySelector('._aaqt a[role="link"]').text;}

The first if-statement always finds the "top_likers" as mentioned by frozenpandaman. The second statement missed the ".text" part so it doesn't work. It works fine for me now.

frozenpandaman commented 9 months ago

Super duper late reply, but thanks a ton @Leimy84! I made a PR in #84 so it's easy for @mittya to merge.

Ascathon commented 8 months ago

Do you by any chance know when 1.28.1 is available at Mozilla. Would love to try things out.

mittya commented 8 months ago

@Ascathon Maybe the staff is on holiday

2023-12-29

Ascathon commented 8 months ago

Even though I don't really care much about this issue, just wanting to say it doesn't seem solved. Opening a picture from a profile page, saving one where there is a "named" like, it will pick that username. In Firefox that is.