downthemall / anticontainer

DownThemAll! AntiContainer (Extension to a Firefox, Seamonkey extension)
Mozilla Public License 2.0
93 stars 41 forks source link

Fix for _r# Tumblr URLs #120

Closed MegaScience closed 7 years ago

MegaScience commented 8 years ago

I realized that Tumblr revision URLs (_r#) weren't being recognized, so this adjustment should fix that. Also VERY slight fixes.

If anyone can improve on this code, feel free. As when I originally wrote it, my goal was to get the downloadable media dynamically. Using the Google Carousel object, it determines image(s) in the page, as well as composing the video URL should one exist in the page. (Tumblr allows images with videos.) It also has a fallback to og:image if for some reason the format changes. These functionalities should be retained.

I'd appreciate cleaner code. I have not been satisfied with how I obtain the video URL (building it from various identifiers in the page instead of finding it as a whole), but videos are presented in iframes and would require making the code more complicated to grab from there. I do know that the video URL will direct to a URL formatted "https://vt.tumblr.com/tumblr_[a-zA-Z\d]+(_r\d+)?.mp4", but since the URL I use is more concise, I assume it should be used to obtain the correct URL. If it is found to be better to use the redirect URL, it can be used.

poke commented 7 years ago

Closed with 09f530bf00a95d767bd4579a141be489f38ad240. Thanks for your contributions!