Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugins.niconicochannelplus: add support for "nicochannel.jp" #4923

Closed
wants to merge 18 commits into from
Closed

plugins.niconicochannelplus: add support for "nicochannel.jp" #4923

wants to merge 18 commits into from

Conversation

pzhlkj6612
Copy link
Contributor

@pzhlkj6612 pzhlkj6612 commented Nov 6, 2022

For VoD and live on "Niconico Channel Plus" (Japanese: ニコニコチャンネルプラス).

Thanks to the following people who provided useful information:

closes #4366

For VoD on "Niconico Channel Plus" (Japanese: ニコニコチャンネルプラス).
https://portal.nicochannel.jp/

Thanks to the following people who provided useful information:

- lokilin, raised a request in issue 2537 of yt-dlp/yt-dlp;
- 雷兰濑 (railannad), raised a request in issue 4366;
- Trung0246, analyzed HTTP data in issue 4366;
- Lesmiscore, made cross-reference between the above two issues.
@pzhlkj6612
Copy link
Contributor Author

Hi, I'm keeping the two commits separated since there seems to be something wrong with our Windows CI and the developing docs. Please squash all commits when merging this PR, thank you in advance.

Copy link
Member

@bastimeyer bastimeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, but I'm afraid we're not going to merge this. We've decided a long time ago that we're not going to merge any more VOD-only plugins and we'll only keep those already implemented until they break and require major changes. Please see the contributing guidelines before opening PRs and ask first before writing new plugins, as explained in the PR template, to avoid wasting time on implementing plugins that won't get merged.

https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#plugin-requests

  1. Sites which don't provide any real live streaming content, eg. only VODs or VODs being rebroadcasted

Since you spent a bit of time implementing this plugin, let me at least give you at least a quick review.


I'll take a look at the metadata decoding error later. Not sure though if it's an actual error and worth fixing, as we want metadata to be in English only.

src/streamlink/plugins/niconicochannelplus.py Outdated Show resolved Hide resolved
src/streamlink/plugins/niconicochannelplus.py Outdated Show resolved Hide resolved
src/streamlink/plugins/niconicochannelplus.py Outdated Show resolved Hide resolved
src/streamlink/plugins/niconicochannelplus.py Outdated Show resolved Hide resolved
@bastimeyer bastimeyer added new plugin disallowed plugin type A disallowed plugin request per https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md labels Nov 6, 2022
@pzhlkj6612
Copy link
Contributor Author

@bastimeyer , thank you for taking time to review my code. This is very detailed.

I'll take a look at the metadata decoding error later. Not sure though if it's an actual error and worth fixing, as we want metadata to be in English only.

OK, I've seen your new PR, and I agree to write only English in metadata.

We've decided a long time ago that we're not going to merge any more VOD-only plugins and we'll only keep those already implemented until they break and require major changes. Please see the contributing guidelines before opening PRs and ask first before writing new plugins, as explained in the PR template, to avoid wasting time on implementing plugins that won't get merged.

Well, I've already read the guideline.
There are both live-streaming and VoD on Niconico Channel Plus. The reason I didn't write the code for lives is they are not available all the time. Therefore, I chose to implement partial support (VoD) for that website, and add the support for lives in the future.
I've written the following lines in the test:

        #   live urls (move it to "should_match*" if the plugin supports live-streaming)
        'https://nicochannel.jp/example/live/sm3Xample',

If possible, I would like to keep this PR open, and:

  • Fix what you mentioned.
  • Support live-streaming in this plugin.

@pzhlkj6612 pzhlkj6612 marked this pull request as draft November 6, 2022 12:39
@railannad
Copy link

@bastimeyer , thank you for taking time to review my code. This is very detailed.

I'll take a look at the metadata decoding error later. Not sure though if it's an actual error and worth fixing, as we want metadata to be in English only.

OK, I've seen your new PR, and I agree to write only English in metadata.

We've decided a long time ago that we're not going to merge any more VOD-only plugins and we'll only keep those already implemented until they break and require major changes. Please see the contributing guidelines before opening PRs and ask first before writing new plugins, as explained in the PR template, to avoid wasting time on implementing plugins that won't get merged.

Well, I've already read the guideline. There are both live-streaming and VoD on Niconico Channel Plus. The reason I didn't write the code for lives is they are not available all the time. Therefore, I chose to implement partial support (VoD) for that website, and add the support for lives in the future. I've written the following lines in the test:

        #   live urls (move it to "should_match*" if the plugin supports live-streaming)
        'https://nicochannel.jp/example/live/sm3Xample',

If possible, I would like to keep this PR open, and:

  • Fix what you mentioned.
  • Support live-streaming in this plugin.

Thank you for your PR. but there are other scripts that can download Vod. eg. Minyami
So I think the support for lives is more important.

- Store all URLs as class members for better human-reading.
- Directly use the "HTTPSession" object which is from the Streamlink
  session instead of passing it from outside.
- Use validation schemas instead of "json.loads" and "__getitem__" ([])
  for better data decoding, JSON validation and exception handling.
- Directly return the result from "HLSStream.parse_variant_playlist"
  since the plugin does not modify the dictionary of streams.
Both ID and channel name are in the URL, so no need to output them.
@mkbloke mkbloke added the PR: squash commits Commits need to be squashed as a single commit - eg. multiple commits for a single component label Nov 7, 2022
@pzhlkj6612 pzhlkj6612 changed the title plugins.niconicochannelplus: add VoD support for "nicochannel.jp" plugins.niconicochannelplus: add support for "nicochannel.jp" Nov 8, 2022
@pzhlkj6612
Copy link
Contributor Author

If possible, I would like to keep this PR open, and:

  • Fix what you mentioned.
  • Support live-streaming in this plugin.

Mission complete.
I've also merged new changes from the upstream branch.


Then, sadly, I found that I'm using single quotes to write the code :-(
Should I change them all to double quotes?

@bastimeyer
Copy link
Member

I'm using single quotes to write the code

We don't want to merge any new code with strings that use single-quote characters. We don't have a linting rule for that because of old code that would need to be changed first. Otherwise, more sophisticated linting tools would need to be used which only check the diff in PRs.

Regarding the plugin implementation itself, this will need a second review. I won't be reviewing this now though, as this won't make it into the 5.1.0 release anyway, and I'm not even sure yet if this plugin can be merged according to the plugin request guidelines.

@mkbloke
Copy link
Member

mkbloke commented Nov 8, 2022

We don't want to merge any new code with strings that use single-quote characters.

I didn't know that. Last I heard, it was "use either, but whichever you choose, use that quoting style consistently".

I wonder if the dev doc should be updated to reflect this?

@pzhlkj6612
Copy link
Contributor Author

We don't want to merge any new code with strings that use single-quote characters.

Fine. The commit is under way.

Regarding the plugin implementation itself, this will need a second review.

Indeed, the code has changed a lot so far.

I won't be reviewing this now though, as this won't make it into the 5.1.0 release anyway

There's no hurry. It doesn't matter if this plugin is not in 5.1.0.

I'm not even sure yet if this plugin can be merged according to the plugin request guidelines.

Well, I've implemented the function to fetch both live and VoD. Am I still missing something?

@bastimeyer
Copy link
Member

Last I heard, it was "use either, but whichever you choose, use that quoting style consistently"

When Streamlink was forked, the coding style was all over the place, and it pretty much still is. This is because no strict linting tools have been used, and over the time, lots of different people have made contributions to lots of different parts, not just plugins.

If we want to change this and have better and consistent code styles via strict code linting tools like black and whatnot, then there are two options:

  1. change and fix everything in one go
  2. gradually change things over time by applying implicit/soft rules

The first solution is a lot of work and it is not ideal either because it would be a giant diff to review, and it also can introduce bugs if you're not careful enough. Not even automated tools can get this right (seriously), so human interactions and human reviews are required for that. Apart from this, there's lots of code which nobody has touched in a long time, like stuff from certain plugins for example, so changing all this, not just strings, is a lot of refactoring work.

The second solution however is being applied for a long time already, for the most part at least, just so that no major new code style issues get introduced. If something gets (or has been) missed, then it's usually not a big deal. If you ask though which is the correct style, then I will give you the correct answer.

Regarding strings, please read this:
https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#strings
Double-quotes are not just a convention made by the devs of black. Rules like this can be found in the vast majority of linting tools (of other programming languages as well) for the reasons mentioned in the linked docs.

I wonder if the dev doc should be updated to reflect this?

If you want to update the dev docs, then go for it.

@mkbloke
Copy link
Member

mkbloke commented Nov 8, 2022

Understood regarding options 1 and 2.

https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html#strings

Very informative, thanks.

I think I have not asked and not seen any mention of quoting style recently, so my understanding was based on very old information. I'm sure when I first started here I was using single quotes consistently, then changed to double quotes. I'm not sure why, but I think it was probably just because I adapted to the style of other regular contributors over time.

I'll have a look at updating the dev doc so that there's something to point to regarding coding style.

@pzhlkj6612
Copy link
Contributor Author

  1. gradually change things over time by applying implicit/soft rules

If psf/black#830 gets implemented, we could apply the rules to all changed lines, to make things consistent gradually, by Black.

@pzhlkj6612
Copy link
Contributor Author

Well, it does make sense. Users can see the title in the webpage.

Outputting the title in debug level looks meaningless, too. Let me remove it now.

Done.

We don't want to merge any new code with strings that use single-quote characters.

Fine. The commit is under way.

Also done.


Now this PR is ready to be reviewed again.


For anyone who wants to test this plugin with live events

Here's a table with all scheduled live for the next 7 days:

Table of live events
START (UTC) URL
2022-11-09 11:00:00 sma4YYxysCeKcCe8VTaQvyN
2022-11-09 11:00:00 smNX2MmMoBfPp2DXhApn8odW
2022-11-09 12:00:00 smQcbJZ6XWqnzUrj8XkGFapa
2022-11-09 13:00:00 sm7FNsiqXHPPHoyBWHhtrUEU
2022-11-09 14:00:00 smGgiRhqv2ZdNxvsuTBaDnx9
2022-11-10 11:55:00 smktbxsNMPGAjHUboP6XdbGj
2022-11-10 12:00:00 sm7MJNz7oD2wK9De9ZJatYNV
2022-11-10 12:00:00 smhrxM6CcMurHihNxavZJWSY
2022-11-10 12:00:00 smJFXFzg9bnejoapWMwSVXeP
2022-11-11 11:00:00 smMNga5ZNinkAqR5Kj3o5p4m
2022-11-11 12:00:00 smjdcdoFaRap6gLCR9TUPbUV
2022-11-11 13:00:00 smUjwTA5Br9HqYMaBoP3TMb6
2022-11-12 10:50:00 smL8EVjDDCnHXdirBJdFuzUN
2022-11-12 12:00:00 smLyCrnxBks8gNPAVujgyzVn
2022-11-12 13:00:00 smq2C2mddb2DhXFCNXntbwQk
2022-11-12 14:50:00 smd2uPQ8p4Ggs6iopVZuaE6D
2022-11-13 11:00:00 smUvrYJnwQf7Y24WBmp8sDqA
2022-11-13 12:00:00 smnsXtEyRRua7xLthaJh8YhX
2022-11-14 11:55:00 smJW2vQpAKpDqThzbPJ55rbg
2022-11-15 10:55:00 sm9i3E4hAepUfcNkAPduX7F9
2022-11-15 11:55:00 smkV9ap7Wr5SHYaSe6kjmZum

And the above table is generated by the following script:

Script for finding scheduled live events
#!/bin/bash


set -e
set -o pipefail
set -u


curl --version >/dev/null
jq --version >/dev/null
sort --version >/dev/null


offset_second=604800  # in one week

now_second=$(date '+%s');
limit_second=$((${now_second} + ${offset_second}));

echo '| START (UTC) | URL |';
echo '| - |:- |';

channel_list="$(curl -sS 'https://nfc-api.nicochannel.jp/fc/content_providers/channels')";

<<<"${channel_list}" jq --compact-output '.data.content_providers | .[]' | \
  while read -r channel_info; do
    fanclub_site_id="$(jq --raw-output '.id' <<<"${channel_info}")";
    domain="$(jq --raw-output '.domain' <<<"${channel_info}")";

    live_page_info="$(
      curl -sS "https://nfc-api.nicochannel.jp/fc/fanclub_sites/${fanclub_site_id}/live_pages?page=1&live_type=2&per_page=1" | \
      jq '.data' \
    )";

    if [[ "${live_page_info}" != 'null' ]]; then
      live_list="$(jq '.video_pages.list' <<<"${live_page_info}")";

      if [[ "${live_list}" != '[]' ]]; then
        the_live="$(jq --compact-output '.[0]' <<<"${live_list}")";

        content_code="$(jq --raw-output '.content_code' <<<"${the_live}")";
        live_scheduled_start_at="$(jq --raw-output '.live_scheduled_start_at' <<<"${the_live}")";

        live_scheduled_start_at_second=$(date --date="${live_scheduled_start_at}" '+%s');

        if [[ ${now_second} -le ${live_scheduled_start_at_second} ]]; then
          if [[ ${live_scheduled_start_at_second} -le ${limit_second} ]]; then
            echo "| ${live_scheduled_start_at} | [${content_code}](${domain}/live/${content_code}) |";
          fi;
        fi;
      fi;
    fi;
  done | \
    sort;

@pzhlkj6612 pzhlkj6612 marked this pull request as ready for review November 8, 2022 18:20
@pzhlkj6612 pzhlkj6612 requested review from bastimeyer and mkbloke and removed request for bastimeyer and mkbloke November 8, 2022 18:20
@bastimeyer
Copy link
Member

Just had a look at the site and what I'm seeing is lots of borderline NSFW content. While this obviously is not a porn site and there's other content as well, this still very much is in conflict with rule 5. Should we decide to merge a plugin for a site like this, then it'll invite more requests for similar content in the future. We've already rejected and closed similar requests in the past.

https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md#plugin-requests

@gravyboat, opinions?

@pzhlkj6612 pzhlkj6612 marked this pull request as draft December 13, 2022 00:36
@pzhlkj6612 pzhlkj6612 marked this pull request as ready for review December 13, 2022 12:44
@railannad
Copy link

railannad commented Dec 20, 2022

Can I ask for a stupid question? I tried the command pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git according to the document but it said error: No plugin can handle URL: xxx
So I want to know if my install command is right
image

@pzhlkj6612 pzhlkj6612 marked this pull request as draft December 20, 2022 15:48
@pzhlkj6612 pzhlkj6612 marked this pull request as ready for review December 20, 2022 16:06
@pzhlkj6612
Copy link
Contributor Author

Hi, @railannad !

Can I ask for a stupid question? I tried the command pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git according to the document but it said error: No plugin can handle URL: xxx So I want to know if my install command is right

Well, you didn't install the git revision which points to the branch contains the code in this PR. Please try this:

pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git@plugin-nicochannel
#                                                                            ^^^^^^^^^^^^^^^^^^^

I found this from:

Tested on a Linux:

$ docker run --rm -it --entrypoint /bin/bash python:3.10.9-bullseye
# pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git@plugin-nicochannel
  Cloning https://github.com/pzhlkj6612/streamlink.git (to revision plugin-nicochannel) to /tmp/...
  Running command git clone --filter=blob:none --quiet https://github.com/pzhlkj6612/streamlink.git /tmp/...
  Running command git checkout -b plugin-nicochannel --track origin/plugin-nicochannel
  Switched to a new branch 'plugin-nicochannel'
  Branch 'plugin-nicochannel' set up to track remote branch 'plugin-nicochannel' from 'origin'.
  Resolved https://github.com/pzhlkj6612/streamlink.git to commit 9661f970f35d3d405604824dd80d099558c0b15f
  ...
...
  ...
...
Successfully installed ... streamlink-4.1.0+275.g9661f970 ...
...
# python -m streamlink 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE' best
[cli][info] streamlink is running as root! Be careful!
[cli][info] Found matching plugin niconicochannelplus for URL https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE
[cli][info] Available streams: 240p (worst), 360p, 480p, 720p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)

It works.


In addition, it would be better if you provide all command lines you executed and execution result as text instead of screenshots. OCRing a long URL is not easy.

You can use a code block like this:

```console
> streamlink.exe ... best
error: No plugin can handle URL: ...
```

It will be rendered as:

> streamlink.exe ... best
error: No plugin can handle URL: ...

:-)

@railannad
Copy link

railannad commented Dec 21, 2022

Thank you for reply. @pzhlkj6612 I tried pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git@plugin-nicochannel
and successfully installed it but it still can not work when the channel_id with dot .

like this: it can work when url is https://nicochannel.jp/komaru-asmr/video/smbsgYVSHd95n8roU4DmgPM5 but can not work when the url is https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE . The reason may be the second channel_id (kanase.ito) has .


C:\Users\28781\AppData\Roaming\Python\Python310\Scripts>set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890

C:\Users\28781\AppData\Roaming\Python\Python310\Scripts>pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git@plugin-nicochannel
Collecting git+https://github.com/pzhlkj6612/streamlink.git@plugin-nicochannel
  Cloning https://github.com/pzhlkj6612/streamlink.git (to revision plugin-nicochannel) to c:\users\28781\appdata\local\temp\pip-req-build-bd7d789t
  Running command git clone --filter=blob:none --quiet https://github.com/pzhlkj6612/streamlink.git 'C:\Users\28781\AppData\Local\Temp\pip-req-build-bd7d789t'
  Running command git checkout -b plugin-nicochannel --track origin/plugin-nicochannel
  branch 'plugin-nicochannel' set up to track 'origin/plugin-nicochannel'.
  Switched to a new branch 'plugin-nicochannel'
  Resolved https://github.com/pzhlkj6612/streamlink.git to commit 9661f970f35d3d405604824dd80d099558c0b15f
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: certifi in e:\python310\lib\site-packages (from streamlink==4.1.0+275.g9661f970) (2022.9.24)
Requirement already satisfied: requests<3.0,>=2.26.0 in e:\python310\lib\site-packages (from streamlink==4.1.0+275.g9661f970) (2.28.1)
Requirement already satisfied: websocket-client<2.0,>=1.2.1 in c:\users\28781\appdata\roaming\python\python310\site-packages (from streamlink==4.1.0+275.g9661f970) (1.4.2)
Requirement already satisfied: isodate in c:\users\28781\appdata\roaming\python\python310\site-packages (from streamlink==4.1.0+275.g9661f970) (0.6.1)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in c:\users\28781\appdata\roaming\python\python310\site-packages (from streamlink==4.1.0+275.g9661f970) (1.7.1)
Requirement already satisfied: pycryptodome<4,>=3.4.3 in c:\users\28781\appdata\roaming\python\python310\site-packages (from streamlink==4.1.0+275.g9661f970) (3.16.0)
Requirement already satisfied: lxml<5.0,>=4.6.4 in e:\python310\lib\site-packages (from streamlink==4.1.0+275.g9661f970) (4.9.1)
Requirement already satisfied: pycountry in c:\users\28781\appdata\roaming\python\python310\site-packages (from streamlink==4.1.0+275.g9661f970) (22.3.5)
Requirement already satisfied: urllib3>=1.26.0 in e:\python310\lib\site-packages (from streamlink==4.1.0+275.g9661f970) (1.26.12)
Requirement already satisfied: charset-normalizer<3,>=2 in e:\python310\lib\site-packages (from requests<3.0,>=2.26.0->streamlink==4.1.0+275.g9661f970) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in e:\python310\lib\site-packages (from requests<3.0,>=2.26.0->streamlink==4.1.0+275.g9661f970) (3.4)
Requirement already satisfied: six in c:\users\28781\appdata\roaming\python\python310\site-packages (from isodate->streamlink==4.1.0+275.g9661f970) (1.16.0)
Requirement already satisfied: setuptools in e:\python310\lib\site-packages (from pycountry->streamlink==4.1.0+275.g9661f970) (63.2.0)
Building wheels for collected packages: streamlink
  Building wheel for streamlink (pyproject.toml) ... done
  Created wheel for streamlink: filename=streamlink-4.1.0+275.g9661f970-py3-none-any.whl size=333494 sha256=cfd5d4a0c0953ab50178774de3763a590b46d0d6981668ab09cf7d36dc7f4a37
  Stored in directory: C:\Users\28781\AppData\Local\Temp\pip-ephem-wheel-cache-3_s9wpi0\wheels\e7\d2\5d\05e291eab3f87019f48ab61d855401714915f78ca06b9c9e92
Successfully built streamlink
Installing collected packages: streamlink
  WARNING: The script streamlink.exe is installed in 'C:\Users\28781\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed streamlink-4.1.0+275.g9661f970

[notice] A new release of pip available: 22.2.1 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\28781\AppData\Roaming\Python\Python310\Scripts>python -m streamlink 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE' best
error: No plugin can handle URL: 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE'

C:\Users\28781\AppData\Roaming\Python\Python310\Scripts>python -m streamlink https://nicochannel.jp/komaru-asmr/video/smbsgYVSHd95n8roU4DmgPM5 best
[cli][info] Found matching plugin niconicochannelplus for URL https://nicochannel.jp/komaru-asmr/video/smbsgYVSHd95n8roU4DmgPM5
[cli][info] Available streams: 240p (worst), 360p, 1080p (best)
[cli][info] Opening stream: 1080p (hls)
error: The default player (VLC) does not seem to be installed. You must specify the path to a player executable with --player, a file path to save the stream with --output, or pipe the stream to another program with --stdout.

C:\Users\28781\AppData\Roaming\Python\Python310\Scripts>

@pzhlkj6612 pzhlkj6612 marked this pull request as draft December 21, 2022 13:07
@pzhlkj6612 pzhlkj6612 marked this pull request as ready for review December 21, 2022 13:10
@pzhlkj6612
Copy link
Contributor Author

@railannad

I tried pip install --user --upgrade git+https://github.com/pzhlkj6612/streamlink.git@plugin-nicochannel and successfully installed it but it still can not work when the channel_id with dot .

like this: it can work when url is https://nicochannel.jp/komaru-asmr/video/smbsgYVSHd95n8roU4DmgPM5 but can not work when the url is https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE . The reason may be the second channel_id (kanase.ito) has .

...
C:\Users\28781\AppData\Roaming\Python\Python310\Scripts>python -m streamlink 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE' best
error: No plugin can handle URL: 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE'

The regex is ^https?://nicochannel\.jp/(?P<channel>[a-z0-9\._-]+)/(?:video|live)/(?P<id>sm[a-zA-Z0-9]+)$ , and you may have to know that CMD doesn't treat single quotes as anything but a regular character. So the leading and trailing single quotes made the matching failed.

To make it work, try:

- python -m streamlink 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE' best
+  python -m streamlink https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE best

Or,

- python -m streamlink 'https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE' best
+ python -m streamlink "https://nicochannel.jp/kanase.ito/video/smRkfW4zmgTkr8rPZcQRPZpE" best

See powershell - Differences between single and double quotes in CMD - Stack Overflow.


I've applied c91c19e to make the regex less strict just now. You can install the latest version and try to pass in a single-quoted URL in CMD.

@railannad
Copy link

Thank you @pzhlkj6612

@bastimeyer
Copy link
Member

Going to close this now. As said, there's too much softcore porn on this site, so I'm not willing to merge this, as this would open the door for many more plugin requests of that kind. We explicitly state in the plugin guidelines that NSFW sites won't be included.

Thanks for the PR though.

@bastimeyer bastimeyer closed this Dec 23, 2022
@pzhlkj6612
Copy link
Contributor Author

Hi everyone! I think that the Niconico Channel Plus website does contain NSFW content. To comply with rules of Streamlink, this plugin should not be merged.

For audiences of that website, you can find the newest "niconicochannelplus.py" file at https://github.com/pzhlkj6612/streamlink-plugins and try to side-load it. Further issues should be sent to my repository instead.

Thanks again for everyone's participation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disallowed plugin type A disallowed plugin request per https://github.com/streamlink/streamlink/blob/master/CONTRIBUTING.md new plugin PR: squash commits Commits need to be squashed as a single commit - eg. multiple commits for a single component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

niconico channel Plus
4 participants