PMPlayer: Can we get support for Nico Nico Douga / nicovideo please? Topic is solved

Add-ons for Pale Moon and other applications
General discussion, compatibility, contributed extensions, themes, plugins, and more.

Moderators: FranklinDM, Lootyhoof

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 885
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by jobbautista9 » 2024-10-14, 09:51

It only requires changing "www.nicovideo.jp" to "embed.nicovideo.jp". Would also be a nice workaround while nicovideo's player is still not working in Pale Moon (the embed works perfectly fine thankfully, example: https://embed.nicovideo.jp/watch/sm8628149).. :think:
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5336
Joined: 2015-12-09, 15:45
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by moonbat » 2024-10-14, 10:47

Heh, didn't realize people do use this extension, seems PureURL is my most popular one so far :)
I'll take a look. I wanted a more ambitious plan for PMPlayer, to let users add their own link and embed detection logic but seems too complicated as of now.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Kerebron
Fanatic
Fanatic
Posts: 117
Joined: 2016-12-04, 22:01

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by Kerebron » 2024-10-14, 16:26

moonbat wrote:
2024-10-14, 10:47
didn't realize people do use this extension
I'm always watching YouTube with PMPlayer.

And I use PureURL, as well. Thank you. :thumbup:

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5336
Joined: 2015-12-09, 15:45
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by moonbat » 2024-10-15, 02:01

I've updated it, try it now :)
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 885
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by jobbautista9 » 2024-10-15, 02:07

Works perfectly, thanks very much! :thumbup:
Attachments
Screenshot 2024-10-15 100603.png
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 885
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by jobbautista9 » 2024-10-15, 02:34

Hmm actually I'm encountering a bug when I try to open a niconico video from a search result with PMPlayer.. It often just errors out (even though it works perfectly fine when I rewrite the URL from www.nicovideo.jp to embed.nicovideo.jp with URL Rewriter), and sometimes it plays the wrong video... For example if you open PMPlayer in this embed, it will play a totally different video: https://embed.nicovideo.jp/watch/sm3970 ... 297c536e00

However opening PMPlayer in the same embed without the trailing garbage in the URL works as expected: https://embed.nicovideo.jp/watch/sm39709086

Looking at what the add-on logs to the console, it seems PMPlayer is always getting "https://embed.nicovideo.jp/watch/sm3888690" (which might be an ad that isn't embeddable) as the embedded version for some reason.

Code: Select all

[PMPlayer:]generateEmbed-matched link: https://www.nicovideo.jp/watch/sm38886905?ref=search_key_video&playlist=eyJ0eXBlIjoic2VhcmNoIiwiY29udGV4dCI6eyJrZXl3b3JkIjoiXHU3OWQ4XHU3OTVlXHUzMGRlXHUzMGJmXHUzMGZjXHUzMGU5Iiwic29ydEtleSI6ImhvdCIsInNvcnRPcmRlciI6Im5vbmUiLCJwYWdlIjoyLCJwYWdlU2l6ZSI6MzJ9fQ&ss_pos=32&ss_id=fde3a785-9456-4f23-aa16-824170926391
 frame URI=  https://embed.nicovideo.jp/watch/sm3888690
 
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 885
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by jobbautista9 » 2024-10-15, 02:58

I was able to workaround it with this short userscript I made for "https://www.nicovideo.jp/search/*":

Code: Select all

var links = document.getElementsByTagName("a");
for (let i = 0; i < links.length; i++) {
 if (links[i].host === location.host) {
  links[i].removeAttribute("data-href");
 }
}
It effectively removes the trailing garbage of all the video URLs in the search results (and I was never a fan of nicovideo turning the search result into a playlist anyway), and also fixes opening the embed in PMPlayer as a bonus.

Btw I didn't use Pure URL for this because there are many query parameters that are too generic (like "ref" and "playlist"), and I wanted all of the query params gone anyway, but only for nicovideo search results (Pure URL doesn't seem to have an option to limit the removal of some parameters to a specific domain or wildcard pattern).
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 5336
Joined: 2015-12-09, 15:45
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by moonbat » 2024-10-15, 03:17

I goofed the URL regex - 7 characters instead of 8 :oops:
Try now.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
jobbautista9
Keeps coming back
Keeps coming back
Posts: 885
Joined: 2020-11-03, 06:47
Location: Philippines
Contact:

Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?

Unread post by jobbautista9 » 2024-10-15, 03:25

Yep, that fixed it, even with my userscript disabled now. Thanks again! :thumbup:
Image

:akko_derp:

XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.

Post Reply