invidious/invidious.php aktualisiert
Now intercepts YouTube links without a leading "www".
This commit is contained in:
parent
52ea77eabb
commit
b781c32c02
|
@ -2,7 +2,7 @@
|
||||||
/*
|
/*
|
||||||
* Name: invidious
|
* Name: invidious
|
||||||
* Description: Replaces links to youtube.com to an invidious instance in all displays of postings on a node.
|
* Description: Replaces links to youtube.com to an invidious instance in all displays of postings on a node.
|
||||||
* Version: 0.3
|
* Version: 0.4
|
||||||
* Author: Matthias Ebers <https://loma.ml/profile/feb>
|
* Author: Matthias Ebers <https://loma.ml/profile/feb>
|
||||||
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
* Author: Michael Vogel <https://pirati.ca/profile/heluecht>
|
||||||
*
|
*
|
||||||
|
@ -95,6 +95,9 @@ function invidious_render(array &$b)
|
||||||
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
||||||
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']);
|
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']);
|
||||||
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']);
|
$b['html'] = preg_replace("/https?:\/\/www.youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']);
|
||||||
|
$b['html'] = preg_replace("/https?:\/\/youtube.com\/watch\?v\=(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
||||||
|
$b['html'] = preg_replace("/https?:\/\/youtube.com\/embed\/(.*?)/ism", $server . '/embed/$1', $b['html']);
|
||||||
|
$b['html'] = preg_replace("/https?:\/\/youtube.com\/shorts\/(.*?)/ism", $server . '/shorts/$1', $b['html']);
|
||||||
$b['html'] = preg_replace("/https?:\/\/youtu.be\/(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
$b['html'] = preg_replace("/https?:\/\/youtu.be\/(.*?)/ism", $server . '/watch?v=$1', $b['html']);
|
||||||
|
|
||||||
if ($original != $b['html']) {
|
if ($original != $b['html']) {
|
||||||
|
|
Loading…
Reference in a new issue