
PMPlayer: Can we get support for Nico Nico Douga / nicovideo please? Topic is solved
Moderators: Lootyhoof, FranklinDM
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
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).. 


"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Knows the dark side
- Posts: 5589
- Joined: 2015-12-09, 15:45
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
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.

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."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net
-
- Fanatic
- Posts: 125
- Joined: 2016-12-04, 22:01
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
I'm always watching YouTube with PMPlayer.
And I use PureURL, as well. Thank you.

Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!
-
- Knows the dark side
- Posts: 5589
- Joined: 2015-12-09, 15:45
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
I've updated it, try it now 

"One hosts to look them up, one DNS to find them and in the darkness BIND them."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
Works perfectly, thanks very much! 

You do not have the required permissions to view the files attached to this post.

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
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.
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

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
I was able to workaround it with this short userscript I made for "https://www.nicovideo.jp/search/*":
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).
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");
}
}
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).

"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.
-
- Knows the dark side
- Posts: 5589
- Joined: 2015-12-09, 15:45
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
I goofed the URL regex - 7 characters instead of 8
Try now.

Try now.
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net

KDE Neon on a Slimbook Excalibur (Ryzen 7 8845HS, 64 GB RAM)
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX
Jabber: moonbat@hot-chili.net
-
- Keeps coming back
- Posts: 953
- Joined: 2020-11-03, 06:47
- Location: Philippines
Re: PMPlayer: Can we get support for Nico Nico Douga / nicovideo please?
Yep, that fixed it, even with my userscript disabled now. Thanks again! 


"Destroying things, smartly!" - IJN Samidare, probably
Avatar artwork by ebifurya: https://www.pixiv.net/artworks/85379109
XUL add-ons developer. You can find a list of add-ons I manage at http://rw.rs/~job/software.html.