[tumblr] update regex for video subdomain #133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There seems to be another sub-domain for videos, apparently..
Not just
vt(.media).tumblr
vtt(media).tumblr
But also
ve(.media).tumblr
Two examples pulled via
\posts\
endpoint on Web API Console:Note that both return
403
, that old issue with videos on Tumblr etc. pp.I think I've only seen one at
ve.media.tumblr.com
so far, but that was working.So this exists 😄
Please comment/change/edit as you see fit.
@mikf I've only tested these changes with the regex101.com tool (Python mode) and not via local Python interpreter or something, but I think this should work.
Also, a question just for understanding:
Do I get this right, that this regex was only intended to match URLs returned from the API that contain something like
_540
,_720
etc.? Because the regex seems not to match at all otherwise. But I think this is intentional, right (The URL does not need to be changed/"improved" here)?Edit:
I mean, just like these two example URLs returned from the Tumblr API above.
The regex does not match at all, and it doesn't need to.
Only for URLs like this (fictional example):
But in this case it should work as expected 😄