[invidious] Now replaces YouTube links without a leading "www." #1494

Merged
MrPetovan merged 2 commits from :develop into develop 2024-04-15 07:12:31 +02:00
Contributor

Now intercepts YouTube links without a leading "www".

Now intercepts YouTube links without a leading "www".
loma-one added 1 commit 2024-04-14 19:46:37 +02:00
Now intercepts YouTube links without a leading "www".
MrPetovan requested changes 2024-04-15 04:38:31 +02:00
Dismissed
@ -97,1 +97,4 @@
$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']);
Owner

This can be accomplished simpler by tweaking the original pattern. I also changed the pattern delimiters to remove some escape characters and I added them back to the literal dot characters.

	$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/shorts/(.*?)~ism", $server . '/shorts/$1', $b['html']);
This can be accomplished simpler by tweaking the original pattern. I also changed the pattern delimiters to remove some escape characters and I added them back to the literal dot characters. ```php $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/shorts/(.*?)~ism", $server . '/shorts/$1', $b['html']); ```
loma-one added 1 commit 2024-04-15 06:03:01 +02:00
MrPetovan approved these changes 2024-04-15 06:18:22 +02:00
Owner

It looks like your branch has conflicts and needs to be rebased onto the parent repository's develop branch before we can merge it. Please let me know if you need help with this.

It looks like your branch has conflicts and needs to be rebased onto the parent repository's `develop` branch before we can merge it. Please let me know if you need help with this.
MrPetovan added the
2024.06
label 2024-04-15 06:19:35 +02:00
MrPetovan changed title from invidious/invidious.php aktualisiert to [invidious] Now replaces YouTube links without a leading "www." 2024-04-15 06:23:30 +02:00
Author
Contributor

That would be very kind of you. As I have only made the changes via the WebUI and do not have a local repository, I cannot make the changes via the console. Thank you very much.

That would be very kind of you. As I have only made the changes via the WebUI and do not have a local repository, I cannot make the changes via the console. Thank you very much.
MrPetovan force-pushed develop from 2d7d11c7d8 to 3bf547ee6e 2024-04-15 07:12:15 +02:00 Compare
MrPetovan merged commit 38466415b3 into develop 2024-04-15 07:12:31 +02:00
Sign in to join this conversation.
No description provided.