Page MenuHomePhabricator

unsupported timed text format
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

What happens?:

  • Unsupported timed text format: An error occurred while loading the API query response: HTTP error: .
MWException: Unsupported timedtext filetype
trace
from /srv/mediawiki/php-1.39.0-wmf.4/extensions/TimedMediaHandler/includes/handlers/TextHandler/TextHandler.php(417)
#0 /srv/mediawiki/php-1.39.0-wmf.4/extensions/TimedMediaHandler/includes/ApiTimedText.php(249): TextHandler::convertSubtitles(string, NULL, string)
#1 /srv/mediawiki/php-1.39.0-wmf.4/includes/libs/objectcache/wancache/WANObjectCache.php(1690): ApiTimedText::{closure}(boolean, integer, array, NULL, array)
#2 /srv/mediawiki/php-1.39.0-wmf.4/includes/libs/objectcache/wancache/WANObjectCache.php(1518): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)
#3 /srv/mediawiki/php-1.39.0-wmf.4/extensions/TimedMediaHandler/includes/ApiTimedText.php(251): WANObjectCache->getWithSetCallback(string, integer, Closure)
#4 /srv/mediawiki/php-1.39.0-wmf.4/extensions/TimedMediaHandler/includes/ApiTimedText.php(153): ApiTimedText->convertTimedText(string, NULL, WikiPage)
#5 /srv/mediawiki/php-1.39.0-wmf.4/includes/api/ApiMain.php(1897): ApiTimedText->execute()

https://logstash.wikimedia.org/goto/d9247031eed4d86c3f6c26be47dfd77f

What should have happened instead?:

  • Should have falling back to either SRT or VTT format ?

These are likely urls from old commons/instacommons integrations, which make the player request subtitles via the old url style ?
Should be easy to fix by making it fallback to SRT I guess, and then we should emit a warning that a format should be specified.

Event Timeline

TheDJ triaged this task as Low priority.Apr 20 2022, 2:11 PM
TheDJ updated the task description. (Show Details)

Change 784695 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/TimedMediaHandler@master] TextHandler: Don't error if the requested syntax is unknown, default to SRT

https://gerrit.wikimedia.org/r/784695

Hmm. Well first we should not throw an exception, if that's not resulting in a proper API error result. That should be fixed. :)

Secondarily I'm not sure why such URLs would exist unless there's a bug, so let's track that down.

May be in TextHandler::getRemoteTextPagesQuery which does a videoinfo query with viprop=timedtext but no trackformat.

Nope, that looks distinct. But I'll double-check what it generates.

Yeah that's fine. The result of that query includes URLs like this:

"timedtext": [
                            {
                                "src": "http://flexo.local:8080/w/api.php?action=timedtext&title=File%3ALIZARD.webm&lang=en&trackformat=srt&origin=%2A",
                                "kind": "subtitles",
                                "type": "text/x-srt",
                                "srclang": "en",
                                "dir": "ltr",
                                "label": "English \u202a(en)\u202c"
                            },
                            {
                                "src": "http://flexo.local:8080/w/api.php?action=timedtext&title=File%3ALIZARD.webm&lang=en&trackformat=vtt&origin=%2A",
                                "kind": "subtitles",
                                "type": "text/vtt",
                                "srclang": "en",
                                "dir": "ltr",
                                "label": "English \u202a(en)\u202c"
                            }
                        ]

So the "old" URLs should already be correct; this code doesn't rely on the current setting on Commons and was already returning both types.

Change 785185 had a related patch set uploaded (by Brion VIBBER; author: Brion VIBBER):

[mediawiki/extensions/TimedMediaHandler@master] Mark api timedtext 'trackformat' param as required

https://gerrit.wikimedia.org/r/785185

Yeah i'm also confused as to where this is coming from. Its rare though, so its pretty low prio.

Change 785185 merged by jenkins-bot:

[mediawiki/extensions/TimedMediaHandler@master] Mark api timedtext 'trackformat' param as required

https://gerrit.wikimedia.org/r/785185

Change 784695 abandoned by TheDJ:

[mediawiki/extensions/TimedMediaHandler@master] TextHandler: Don't error if the requested syntax is unknown, default to SRT

Reason:

Abandoned in favor of https://gerrit.wikimedia.org/r/785185

https://gerrit.wikimedia.org/r/784695

TheDJ assigned this task to brooke.
TheDJ removed a project: Patch-For-Review.