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

[ie/niconico] remove unusable legacy danmaku (comments, subtitle) extraction #9209

Merged
merged 3 commits into from Feb 17, 2024

Conversation

pzhlkj6612
Copy link
Contributor

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Hi.

Fixes #8684

See also: #6773

CAUTION: This PR completely removes the code about legacy danmaku extraction.

The "new danmaku extraction" logic works fine, by the way.

Test

It seems that all /comment/threads/.../server are empty strings, I guess the legacy endpoint has been shut down.

Here is the api_data of sm16309076 - 「Thousand Cherry Blossoms」 Played it【Piano】 - ニコニコ動画:

{
  ...
  "comment": {
    "server": {
      "url": ""
    },
    "keys": {
      "userKey": ""
    },
    "layers": [
      {
        "index": 0,
        "isTranslucent": false,
        "threadIds": [
          {
            "id": 1322648373,
            "fork": 1,
            "forkLabel": "owner"
          }
        ]
      },
      {
        "index": 1,
        "isTranslucent": false,
        "threadIds": [
          {
            "id": 1322648373,
            "fork": 0,
            "forkLabel": "main"
          },
          {
            "id": 1322648373,
            "fork": 2,
            "forkLabel": "easy"
          }
        ]
      }
    ],
    "threads": [
      {
        "id": 1322648373,
        "fork": 1,
        "forkLabel": "owner",
        "videoId": "sm16309076",
        "isActive": false,
        "isDefaultPostTarget": false,
        "isEasyCommentPostTarget": false,
        "isLeafRequired": false,
        "isOwnerThread": true,
        "isThreadkeyRequired": false,
        "threadkey": null,
        "is184Forced": false,
        "hasNicoscript": true,
        "label": "owner",
        "postkeyStatus": 0,
        "server": ""                         <-----------------
      },
      {
        "id": 1322648373,
        "fork": 0,
        "forkLabel": "main",
        "videoId": "sm16309076",
        "isActive": true,
        "isDefaultPostTarget": true,
        "isEasyCommentPostTarget": false,
        "isLeafRequired": true,
        "isOwnerThread": false,
        "isThreadkeyRequired": false,
        "threadkey": null,
        "is184Forced": false,
        "hasNicoscript": false,
        "label": "default",
        "postkeyStatus": 0,
        "server": ""                         <-----------------
      },
      {
        "id": 1322648373,
        "fork": 2,
        "forkLabel": "easy",
        "videoId": "sm16309076",
        "isActive": true,
        "isDefaultPostTarget": false,
        "isEasyCommentPostTarget": true,
        "isLeafRequired": true,
        "isOwnerThread": false,
        "isThreadkeyRequired": false,
        "threadkey": null,
        "is184Forced": false,
        "hasNicoscript": false,
        "label": "easy",
        "postkeyStatus": 0,
        "server": ""                         <-----------------
      }
    ],
    "ng": {
      "ngScore": {
        "isDisabled": false
      },
      "channel": [],
      "owner": [],
      "viewer": {
        "revision": 1,
        "count": 0,
        "items": []
      }
    },
    "isAttentionRequired": false,
    "nvComment": {
      "threadKey": "eyJ0...",
      "server": "https://nv-comment.nicovideo.jp",
      "params": {
        "targets": [
          {
            "id": "1322648373",
            "fork": "owner"
          },
          {
            "id": "1322648373",
            "fork": "main"
          }
        ],
        "language": "en-us"
      }
    }
  },
  ...
Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

@seproDev seproDev added the site-bug Issue with a specific website label Feb 14, 2024
@pzhlkj6612 pzhlkj6612 marked this pull request as draft February 17, 2024 05:44
@pzhlkj6612 pzhlkj6612 marked this pull request as ready for review February 17, 2024 17:47
yt_dlp/extractor/niconico.py Outdated Show resolved Hide resolved
@bashonly bashonly self-assigned this Feb 17, 2024
@bashonly bashonly merged commit 974d444 into yt-dlp:master Feb 17, 2024
6 checks passed
@pzhlkj6612 pzhlkj6612 deleted the niconico-old-comments-invalid branch February 18, 2024 02:08
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[niconico] subtitle-related options result in error
3 participants