Skip to content

Provider features for 4.7.0 - #593

Open
Vitorinox wants to merge 8 commits into
masterfrom
feat/providers-4.7.0
Open

Vitorinox wants to merge 8 commits into
masterfrom
feat/providers-4.7.0

Conversation

@Vitorinox

Copy link
Copy Markdown
Collaborator

Provider features planned for 4.7.0. One commit per issue, plus real-page snapshots and docs. All existing fixtures give the same results; the new behavior is covered by offline tests in tests/ProviderFeaturesTest.php and tests/ChineseProvidersTest.php, and by two new real-page snapshots (Tencent Video and a public Google Drive video).

Resolved

  • YouTube maxresdefault.jpg (Fixes Use maxresdefault instead of hqdefault for YouTube embeds #535): $info->image uses maxresdefault.jpg when the video page links it in og:image (YouTube only does it when the video has one), and keeps the oEmbed hqdefault.jpg otherwise. Only an image of the same video id is accepted.
  • YouTube start and end times (Fixes youtube end time parameter? #268): YouTube's oEmbed always drops end= and also loses t=/start= because Embed asks it for the canonical URL. Both are now added to the player URL from the requested URL, in seconds or in the 1m30s format. Checked live: watch?v=ID&t=10&end=20 gives embed/ID?feature=oembed&start=10&end=20.
  • Vimeo full size thumbnail (Fixes Vimeo - Is it possible to get a higher quality version of the image?  #391): new Vimeo adapter whose image detector drops the size suffix of the oEmbed thumbnail (..._295x166), which makes Vimeo's CDN serve the full size image (checked: 295x166 becomes 1280x720 or 1920x1440). The resized one stays available in getOEmbed()->url('thumbnail_url').
  • Google Drive (Fixes Google Drive support #408): new adapter for drive.google.com/file/d/<id>/(view|edit|preview), /file/u/<n>/d/<id>/... and /open?id=<id>. It builds the same /preview iframe as Drive's "Embed item" option. Files that answer with an error status (private or deleted, like the existing 0B2rwN8... snapshot, which answers 401) get no code, so that snapshot is unchanged.

Partially covered

  • Provider name (Provider Name wrongly capitalised for many websites #462): the name is now also read from the application-name and apple-mobile-web-app-title metas before falling back to the domain, and the fallback skips www (eportugal.gov.pt now redirects to www.gov.pt, which gave "Www"; it now gives "Gov"). The README explains how to replace the detector to get null instead of the fallback, as asked in the thread. A site that declares no name at all still gets the capitalized domain, so this does not close the issue.
  • Chinese video providers (Chinese video providers #243): adds a Tencent Video adapter that builds the official v.qq.com/txp/iframe/player.html?vid=<vid> player from v.qq.com/x/cover/<cid>/<vid>.html, v.qq.com/x/page/<vid>.html and v.qq.com/x/cover/<cid>.html?vid=<vid> URLs (cover URLs without a vid point to a whole series and get no code). The page is rendered with JavaScript, so title and image are usually missing. Status of the rest of the list, checked live on 2026-11-20:
    • Already covered in 4.6.0: Youku, Bilibili, NetEase Music.
    • iQiyi: video pages are a JavaScript shell; the tvid needed by its player is not in the HTML, so there is no player that can be built from the URL. Left out.
    • Sohu TV: the number in the URL (n600854351) is a page id, not the player vid, so the iplay.html player cannot be built from the URL. Generic extraction already gets title, description and image.
    • 56.com: its iframe page is the same for any id, so the player could not be verified. Generic extraction gets title and description.
    • Mango TV, PPTV, Le.com: no HTML5 iframe player found. Generic extraction gets title and description (and image for PPTV).
    • ifeng: already gets a <video> tag from og:video.
    • Tudou: blocks cloud IPs (cloud_ip_bl) and now belongs to Youku.
    • 1905.com: answers 403 to cloud IPs.
    • Yinyuetai: alive, but a JavaScript app.
    • Not answering: v.ku6.com, wasu.cn, kankan.com. Xiami closed in 2021 (redirects to a closing notice).

Left out

  • Reddit (Reddit data is very lacking #521): Reddit answers 403 to every request from cloud IPs (www, old.reddit.com and the .json API), except for allowlisted link preview crawlers, and the share.redd.it preview image is a generic placeholder for other clients. The old.reddit.com rewrite proposed in the issue could not be verified from a residential connection, so it is not included.
  • Iframe width and height (Iframe code width and height #479): not a provider feature. $info->code->ratio plus CSS (aspect-ratio or the padding technique) already covers it, as answered in the thread.

Tests

PHPUnit passes on PHP 7.4, 8.1, 8.2, 8.3, 8.4 and 8.5 (331 tests). PHPStan reports no errors. PHP 8.0 is covered by CI.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant