Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.9k stars 1.48k forks source link

Improve Wikimedia import options #4879

Closed JimKillock closed 2 years ago

JimKillock commented 2 years ago

Include licence, description and subtitle files when importing from Wikimedia Commons. Currently, an import from a URL such as https://commons.wikimedia.org/wiki/File:Die_Temperaturkurve_der_Erde_(ZDF,_Terra_X)_720p_HD_50FPS.webm will include the video and title, but other information is not imported.

Subtile files, licence information and a link to WM Commons for further details would be particularly useful.

Include on import:

This can of course be done manually but would be excellent to make easier where there are many videos to import and publish on PeerTube

Note that I am not sure whether this task ought to be done through the information collected by youtube-dl or is better or would be needed to be done by Peertube, so I raised a discussion here.

Chocobozzz commented 2 years ago

Hello,

We use yt-dlp or youtube-dl to grab this information, so the issue on their side should be enough: https://github.com/ytdl-org/youtube-dl/issues/30777

Regarding subtitles, for now PeerTube only supports vtt but you can create another issue so we support srt imports. But youtube-dl extractor needs to be fixed first:

  "subtitles": {
    "de": [
      {
        "url": "https://commons.wikimedia.org/w/api.php?action=timedtext&title=File%3ADie_Temperaturkurve_der_Erde_%28ZDF%2C_Terra_X%29_720p_HD_50FPS.webm&lang=de&trackformat=srt",
        "ext": "php"
      }
    ],
    "en-GB": [
      {
        "url": "https://commons.wikimedia.org/w/api.php?action=timedtext&title=File%3ADie_Temperaturkurve_der_Erde_%28ZDF%2C_Terra_X%29_720p_HD_50FPS.webm&lang=en-gb&trackformat=srt",
        "ext": "php"
      }
    ],
    "nl": [
      {
        "url": "https://commons.wikimedia.org/w/api.php?action=timedtext&title=File%3ADie_Temperaturkurve_der_Erde_%28ZDF%2C_Terra_X%29_720p_HD_50FPS.webm&lang=nl&trackformat=srt",
        "ext": "php"
      }
    ]
  }

ext should be srt

JimKillock commented 2 years ago

Hi @Chocobozzz is the code above a demonstration of the problem at youtube-dl ? is there something I should communicate to Youtube-dl that will hasten this (Apologies as I'm not an engineer, just a tinkerer).

JimKillock commented 2 years ago

I think I see at leat some of what you mean; I assume above is the output you get. Running the software on desktop I've been able to reproduce the error and have raised it with yt-dip also

JimKillock commented 2 years ago

@Chocobozzz we nearly have an extractor file done but are stuck on how to retrieve a list of subtitles from WM Commons - what did you do to get the result above?

JimKillock commented 2 years ago

We found the WM API call. So don't worry about this.