bugdown: Fetch youtube preview images over HTTPS.

(imported from commit 9dbf3c21083cbbcf1288789f400c33ec735d4416)
This commit is contained in:
Tim Abbott 2013-09-04 15:12:33 -04:00
parent 3f1c967e3d
commit cdfc6dc10a
2 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor):
match = re.match(youtube_re, url)
if match is None:
return None
return "http://i.ytimg.com/vi/%s/default.jpg" % (match.group(2),)
return "https://i.ytimg.com/vi/%s/default.jpg" % (match.group(2),)
def twitter_link(self, url):
tweet_id = get_tweet_id(url)

View File

@ -2624,7 +2624,7 @@ xxxxxxx</strong></p>\n<p>xxxxxxx xxxxx xxxx xxxxx:<br>\n<code>xxxxxx</code>: xxx
if settings.USING_EMBEDLY:
self.assertEqual(converted, '<p>Check out the debate: <a href="http://www.youtube.com/watch?v=hx1mjT73xYE" target="_blank" title="http://www.youtube.com/watch?v=hx1mjT73xYE">http://www.youtube.com/watch?v=hx1mjT73xYE</a></p>\n<iframe width="250" height="141" src="http://www.youtube.com/embed/hx1mjT73xYE?feature=oembed" frameborder="0" allowfullscreen></iframe>')
else:
self.assertEqual(converted, '<p>Check out the debate: <a href="http://www.youtube.com/watch?v=hx1mjT73xYE" target="_blank" title="http://www.youtube.com/watch?v=hx1mjT73xYE">http://www.youtube.com/watch?v=hx1mjT73xYE</a></p>\n<div class="message_inline_image"><a href="http://www.youtube.com/watch?v=hx1mjT73xYE" target="_blank" title="http://www.youtube.com/watch?v=hx1mjT73xYE"><img src="http://i.ytimg.com/vi/hx1mjT73xYE/default.jpg"></a></div>')
self.assertEqual(converted, '<p>Check out the debate: <a href="http://www.youtube.com/watch?v=hx1mjT73xYE" target="_blank" title="http://www.youtube.com/watch?v=hx1mjT73xYE">http://www.youtube.com/watch?v=hx1mjT73xYE</a></p>\n<div class="message_inline_image"><a href="http://www.youtube.com/watch?v=hx1mjT73xYE" target="_blank" title="http://www.youtube.com/watch?v=hx1mjT73xYE"><img src="https://i.ytimg.com/vi/hx1mjT73xYE/default.jpg"></a></div>')
def test_inline_dropbox(self):
msg = 'Look at how hilarious our old office was: https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG'