Home
Forums
New posts
Search forums
What's new
New posts
New media
New media comments
New resources
New profile posts
Latest activity
Media
New media
New comments
Search media
Resources
Latest reviews
Search resources
Members
Current visitors
New profile posts
Search profile posts
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Official XenForo add-ons
Media Gallery bug reports
Media Gallery resolved bugs
YouTube preview image not retrieved if &list is in in the URL
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Kevin" data-source="post: 1546531" data-attributes="member: 21"><p>Yeah, it looks like an update to the YT URL parsing over the years may have broken it. </p><p></p><p style="margin-left: 20px">The function [icode]matchCallback[/icode] in /XF/Bbode/Helper/YouTube.php looks for the 'list' parameter and if found saves it as part of the matched media ID (so a URL like [icode]https://www.youtube.com/watch?v=a01QQZyl-_I&list=PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf&index=10[/icode] gets turned into [icode]a01QQZyl-_I, list: PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf[/icode] for the matched ID.</p> <p style="margin-left: 20px"></p> <p style="margin-left: 20px">That seems to work fine everywhere in XF since the video IDs are recognized & parsed as needed to embed the YT code and is why the actual video still plays in XFMG.</p> <p style="margin-left: 20px"></p> <p style="margin-left: 20px">With XFMG when retrieving the thumbnail the function [icode]getTempThumbnailPath[/icode] in /src/addons/XFMG/EmbedData/YouTube.php seems to be looking for a video ID with a ":" colon in it and, if found, to parse out just the actual video ID [icode]a01QQZyl-_I[/icode] when creating the thumbnail URL. So the XF devs know that the media ID could have extra data in it and to work around it to get the real ID.</p> <p style="margin-left: 20px"></p> <p style="margin-left: 20px">But in the example of [icode]a01QQZyl-_I, list: PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf[/icode] it doesn't get matched in the regex so the URL requested ends up as [icode]https://i.ytimg.com/vi/a01QQZyl-_I, list: PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf/maxresdefault.jpg[/icode] instead of [icode]https://i.ytimg.com/vi/a01QQZyl-_I/maxresdefault.jpg[/icode] so it of course fails.</p> <p style="margin-left: 20px"></p> <p style="margin-left: 20px">My guess is that the regex needs to be updated. Maybe something like [icode](.*)(\,\.*)[/icode] to parse on "," instead of the colon but this is where the XF guys know what they're doing far better than I so I'll wait & see what the patch fix looks like. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big grin :D" loading="lazy" data-shortname=":D" /> </p> <p style="margin-left: 20px"></p></blockquote><p></p>
[QUOTE="Kevin, post: 1546531, member: 21"] Yeah, it looks like an update to the YT URL parsing over the years may have broken it. [INDENT]The function [icode]matchCallback[/icode] in /XF/Bbode/Helper/YouTube.php looks for the 'list' parameter and if found saves it as part of the matched media ID (so a URL like [icode]https://www.youtube.com/watch?v=a01QQZyl-_I&list=PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf&index=10[/icode] gets turned into [icode]a01QQZyl-_I, list: PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf[/icode] for the matched ID.[/INDENT] [INDENT][/INDENT] [INDENT]That seems to work fine everywhere in XF since the video IDs are recognized & parsed as needed to embed the YT code and is why the actual video still plays in XFMG.[/INDENT] [INDENT][/INDENT] [INDENT]With XFMG when retrieving the thumbnail the function [icode]getTempThumbnailPath[/icode] in /src/addons/XFMG/EmbedData/YouTube.php seems to be looking for a video ID with a ":" colon in it and, if found, to parse out just the actual video ID [icode]a01QQZyl-_I[/icode] when creating the thumbnail URL. So the XF devs know that the media ID could have extra data in it and to work around it to get the real ID.[/INDENT] [INDENT][/INDENT] [INDENT]But in the example of [icode]a01QQZyl-_I, list: PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf[/icode] it doesn't get matched in the regex so the URL requested ends up as [icode]https://i.ytimg.com/vi/a01QQZyl-_I, list: PLmXxqSJJq-yXrCPGIT2gn8b34JjOrl4Xf/maxresdefault.jpg[/icode] instead of [icode]https://i.ytimg.com/vi/a01QQZyl-_I/maxresdefault.jpg[/icode] so it of course fails.[/INDENT] [INDENT][/INDENT] [INDENT]My guess is that the regex needs to be updated. Maybe something like [icode](.*)(\,\.*)[/icode] to parse on "," instead of the colon but this is where the XF guys know what they're doing far better than I so I'll wait & see what the patch fix looks like. :D [/INDENT] [INDENT][/INDENT] [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Official XenForo add-ons
Media Gallery bug reports
Media Gallery resolved bugs
YouTube preview image not retrieved if &list is in in the URL
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top