af_redditimgur: handle youtube /embed/ URLs
This commit is contained in:
parent
43e9dd5ea9
commit
6c546f37ba
|
@ -354,6 +354,7 @@ class Af_RedditImgur extends Plugin {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if (!$found && (preg_match("/youtube\.com\/v\/([\w-]+)/", $entry_href, $matches) ||
|
if (!$found && (preg_match("/youtube\.com\/v\/([\w-]+)/", $entry_href, $matches) ||
|
||||||
preg_match("/youtube\.com\/.*?[\&\?]v=([\w-]+)/", $entry_href, $matches) ||
|
preg_match("/youtube\.com\/.*?[\&\?]v=([\w-]+)/", $entry_href, $matches) ||
|
||||||
|
preg_match("/youtube\.com\/embed\/([\w-]+)/", $entry_href, $matches) ||
|
||||||
preg_match("/youtube\.com\/watch\?v=([\w-]+)/", $entry_href, $matches) ||
|
preg_match("/youtube\.com\/watch\?v=([\w-]+)/", $entry_href, $matches) ||
|
||||||
preg_match("/\/\/youtu.be\/([\w-]+)/", $entry_href, $matches))) {
|
preg_match("/\/\/youtu.be\/([\w-]+)/", $entry_href, $matches))) {
|
||||||
|
|
||||||
|
@ -490,9 +491,6 @@ class Af_RedditImgur extends Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($found)
|
|
||||||
$this->remove_post_thumbnail($doc, $xpath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$found && $anchor && count($this->fallback_preview_urls) > 0) {
|
if (!$found && $anchor && count($this->fallback_preview_urls) > 0) {
|
||||||
|
@ -505,6 +503,9 @@ class Af_RedditImgur extends Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($found)
|
||||||
|
$this->remove_post_thumbnail($doc, $xpath);
|
||||||
|
|
||||||
return $found;
|
return $found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue