Closed ToshY closed 1 year ago
Anime returns youtube id with 12 characters instead of 11.
Example 16904 gives yhNzL20gNX0/ instead of yhNzL20gNX0.
yhNzL20gNX0/
yhNzL20gNX0
While the original embed URL (with additional /) does work, the regex does not take this into account that it should only be 11 characters for the id.
/
See this line in Media.php.
Media.php
Correct match for id, possible solutions:
([^\?&\"'>]+)
([^\?&\"'>]{11})
$matches[1] ?? null
empty($matches[1]) === false ? substr($matches[1], 0, 11) : null
@irfan-dahir I can create a PR for this if you prefer one of the solutions I provided.
Problem
Anime returns youtube id with 12 characters instead of 11.
Reproduction
Example 16904 gives
yhNzL20gNX0/
instead ofyhNzL20gNX0
.Cause
While the original embed URL (with additional
/
) does work, the regex does not take this into account that it should only be 11 characters for the id.See this line in
Media.php
.Possible fixes
Correct match for id, possible solutions:
([^\?&\"'>]+)
to([^\?&\"'>]{11})
$matches[1] ?? null
toempty($matches[1]) === false ? substr($matches[1], 0, 11) : null