My script works fine doing this:
images = re.findall(\"src.\\\"(\\S*?media.tumblr\\S*?tumblr_\\S*?jpg)\", doc) videos = re.findall(\"\\S*?(http\\S*?video_file\\S
As mentioned in the comments, a pipe (|) should do the trick.
a pipe (|)
The regular expression
(src.\"(\S*?media.tumblr\S*?tumblr_\S*?jpg))|(\S*?(http\S*?video_file\S*?tumblr_[a-zA-Z0-9]*))
catches either of the two patterns.
Demo on Regex Tester