SN-Koarashi / ig-helper

In Instagram, downloading is possible for both photos and videos from posts, as well as for stories, reels or profile picture.
GNU General Public License v3.0
41 stars 3 forks source link

Another way to detect stories page #28

Closed sn-o-w closed 3 months ago

sn-o-w commented 3 months ago

x5qyhuo is a class you will find only inside Stories. Let's try another approach without using the class name.

sn-o-w commented 3 months ago

@SN-Koarashi I hope this is better. 😊

SN-Koarashi commented 3 months ago

Ummm...Although it uses relative position, it becomes difficult to read.

sn-o-w commented 3 months ago

Ummm...Although it uses relative position, it becomes difficult to read.

Why difficult to read? 🤔

SN-Koarashi commented 3 months ago

CSS selectors from the left to the right should make the scope smaller and smaller and more specific to the target, and the way you use it mostly uses "*", which will make the purpose unclear.

But the undeniable result is that according to the benchmark test results, your writing method can be executed 125,216 times per second, while my writing method has three judgment formulas, and the slowest one can only be executed 48,653 times per second. Although it is excellent in terms of performance, it is not so readable for writers (especially for future debugging).

sn-o-w commented 3 months ago

CSS selectors from the left to the right should make the scope smaller and smaller and more specific to the target, and the way you use it mostly uses "*", which will make the purpose unclear.

Do you prefer div[id^="mount"] > div > div > div > div > div > div > div > section? 🤔

SN-Koarashi commented 3 months ago

This is indeed better. But since Instagram is not a unified layout for every user, I'm not sure whether such strict class checking will cause undetectable problems.

SN-Koarashi commented 3 months ago

This is indeed better. But since Instagram is not a unified layout for every user, I'm not sure whether such strict class checking will cause undetectable problems.

Based on the above it, if I need to merge and submit, I will keep my old code in comments to facilitate debugging in the future.

sn-o-w commented 3 months ago

This is indeed better. But since Instagram is not a unified layout for every user, I'm not sure whether such strict class checking will cause undetectable problems.

Well, it's impossible for us to fix things we cannot see or experiment. 😆