Skip to content

Commit 1a6fd79

Browse files
committed
MediaEmbed: updated Youku
Closes #246
1 parent 85d45dc commit 1a6fd79

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

docs/Plugins/MediaEmbed/Sites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@
539539
</tr>
540540
<tr title="Youku" id="youku">
541541
<td><code>youku</code></td>
542-
<td>https://v.youku.com/v_show/id_XMzY0NTMyMTgxMg==.html</td>
542+
<td>https://v.youku.com/v_show/id_XNTE3ODIxMDEzNg==.html</td>
543543
</tr>
544544
<tr title="YouMaker" id="youmaker">
545545
<td><code>youmaker</code></td>

docs/testdox.txt

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8006,39 +8006,39 @@ Unparser (s9e\TextFormatter\Tests\Unparser)
80068006
[x] Characters outside Unicode's BMP are decoded
80078007

80088008
Cached (s9e\TextFormatter\Tests\Utils\Http\Clients\Cached)
8009-
[ ] Settings from the proxied client are copied
8010-
[ ] Settings from the caching client are copied to the proxied client
8011-
[ ] Can work without a cache dir
8012-
[ ] Works with a cache
8013-
[ ] Uses gzip by default if ext/zlib is availble
8014-
[ ] Sends custom headers
8015-
[ ] Resets custom headers between requests
8016-
[ ] post() sends the request body if set
8017-
[ ] post() sends no request body if not set
8018-
[ ] post() automatically sets Content-Length if a request body is set
8019-
[ ] get() returns the response error
8020-
[ ] get() returns headers if returnHeaders is true
8009+
[x] Settings from the proxied client are copied
8010+
[x] Settings from the caching client are copied to the proxied client
8011+
[x] Can work without a cache dir
8012+
[x] Works with a cache
8013+
[x] Uses gzip by default if ext/zlib is availble
8014+
[x] Sends custom headers
8015+
[x] Resets custom headers between requests
8016+
[x] post() sends the request body if set
8017+
[x] post() sends no request body if not set
8018+
[x] post() automatically sets Content-Length if a request body is set
8019+
[x] get() returns the response error
8020+
[x] get() returns headers if returnHeaders is true
80218021

80228022
Curl (s9e\TextFormatter\Tests\Utils\Http\Clients\Curl)
8023-
[ ] Uses gzip by default if ext/zlib is availble
8024-
[ ] Sends custom headers
8025-
[ ] Resets custom headers between requests
8026-
[ ] post() sends the request body if set
8027-
[ ] post() sends no request body if not set
8028-
[ ] post() automatically sets Content-Length if a request body is set
8029-
[ ] get() returns the response error
8030-
[ ] get() returns headers if returnHeaders is true
8023+
[x] Uses gzip by default if ext/zlib is availble
8024+
[x] Sends custom headers
8025+
[x] Resets custom headers between requests
8026+
[x] post() sends the request body if set
8027+
[x] post() sends no request body if not set
8028+
[x] post() automatically sets Content-Length if a request body is set
8029+
[x] get() returns the response error
8030+
[x] get() returns headers if returnHeaders is true
80318031

80328032
Native (s9e\TextFormatter\Tests\Utils\Http\Clients\Native)
8033-
[ ] Does not send "Accept-Encoding: gzip" if gzip is disabled
8034-
[ ] Uses gzip by default if ext/zlib is availble
8035-
[ ] Sends custom headers
8036-
[ ] Resets custom headers between requests
8037-
[ ] post() sends the request body if set
8038-
[ ] post() sends no request body if not set
8039-
[ ] post() automatically sets Content-Length if a request body is set
8040-
[ ] get() returns the response error
8041-
[ ] get() returns headers if returnHeaders is true
8033+
[x] Does not send "Accept-Encoding: gzip" if gzip is disabled
8034+
[x] Uses gzip by default if ext/zlib is availble
8035+
[x] Sends custom headers
8036+
[x] Resets custom headers between requests
8037+
[x] post() sends the request body if set
8038+
[x] post() sends no request body if not set
8039+
[x] post() automatically sets Content-Length if a request body is set
8040+
[x] get() returns the response error
8041+
[x] get() returns headers if returnHeaders is true
80428042

80438043
Http (s9e\TextFormatter\Tests\Utils\Http)
80448044
[x] getClient() returns an instance of s9e\TextFormatter\Utils\Http\Client

src/Plugins/MediaEmbed/Configurator/Collections/CachedDefinitionCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
144144
'xboxclips'=>['attributes'=>[],'example'=>'https://gameclips.io/boulderBaby5568/035a50fa-2d54-4820-aa44-f0f43a873308','extract'=>['@(?:gameclips\\.io|xboxclips\\.com)/(?!game/)(?\'user\'[^/]+)/(?!screenshots/)(?\'id\'[-0-9a-f]+)@'],'homepage'=>'https://gameclips.io/','host'=>['gameclips.io','xboxclips.com'],'iframe'=>['height'=>315,'src'=>'//gameclips.io/{@user}/{@id}/embed','width'=>560],'name'=>'GameClips.io','scrape'=>[],'tags'=>['gaming']],
145145
'xboxdvr'=>['attributes'=>[],'example'=>'https://gamerdvr.com/gamer/LOXITANE/video/12463958','extract'=>['!(?:gamer|xbox)dvr\\.com/gamer/(?\'user\'[^/]+)/video/(?\'id\'\\d+)!'],'homepage'=>'https://gamerdvr.com/','host'=>['gamerdvr.com','xboxdvr.com'],'iframe'=>['src'=>'//gamerdvr.com/gamer/{@user}/video/{@id}/embed'],'name'=>'Gamer DVR','scrape'=>[],'tags'=>['gaming']],
146146
'xenforo'=>['attributes'=>['content_id'=>['filterChain'=>['#identifier'],'required'=>false],'post_id'=>['filterChain'=>['#uint'],'required'=>false],'profile_post_id'=>['filterChain'=>['#uint'],'required'=>false],'resource_id'=>['filterChain'=>['#uint'],'required'=>false],'thread_id'=>['filterChain'=>['#uint'],'required'=>false],'url'=>['filterChain'=>['#url'],'required'=>true],'xfmg_album_id'=>['filterChain'=>['#uint'],'required'=>false]],'example'=>'https://xenforo.com/community/threads/embed-your-content-anywhere.217381/','extract'=>['!^(?\'url\'https://.*?/)media/albums/(?:[-\\w]+\\.)?(?\'xfmg_album_id\'\\d+)!','!^(?\'url\'https://.*?/)(?:members/[-.\\w]+/#profile-post-|profile-posts/)(?\'profile_post_id\'\\d+)!','!^(?\'url\'https://.*?/)resources/(?:[-\\w]+\\.)?(?\'resource_id\'\\d+)!','!^(?\'url\'https://.*?/)threads/(?:[-\\w]+\\.)?(?\'thread_id\'\\d+)/(?:page-\\d+)?#?(?:post-(?\'post_id\'\\d+))?!','!^(?\'url\'https://.*?/)embed\\.php\\?content=(?\'content_id\'[-\\w]+)!'],'helper'=>'s9e\\TextFormatter\\Plugins\\MediaEmbed\\Configurator\\SiteHelpers\\XenForoHelper','host'=>[],'iframe'=>['data-s9e-livepreview-ignore-attrs'=>'style','height'=>300,'onload'=>'let c=new MessageChannel;c.port1.onmessage=e=>this.style.height=e.data+\'px\';this.contentWindow.postMessage(\'s9e:init\',\'*\',[c.port2])','src'=>'https://s9e.github.io/iframe/2/xenforo.min.html#<xsl:value-of select="@url"/><xsl:choose><xsl:when test="@profile_post_id">profile-posts/<xsl:value-of select="@profile_post_id"/></xsl:when><xsl:when test="@resource_id">resources/<xsl:value-of select="@resource_id"/></xsl:when><xsl:when test="@xfmg_album_id">media/albums/<xsl:value-of select="@xfmg_album_id"/></xsl:when><xsl:otherwise>threads/<xsl:value-of select="@thread_id"/><xsl:if test="@post_id">/post-<xsl:value-of select="@post_id"/></xsl:if></xsl:otherwise></xsl:choose>','width'=>'100%'],'name'=>'XenForo','scrape'=>[],'tags'=>['social']],
147-
'youku'=>['attributes'=>[],'example'=>'https://v.youku.com/v_show/id_XMzY0NTMyMTgxMg==.html','extract'=>['!youku\\.com/v(?:_show|ideo)/id_(?\'id\'\\w+=*)!'],'homepage'=>'https://www.youku.com/','host'=>['youku.com'],'iframe'=>['src'=>'//player.youku.com/embed/{@id}'],'name'=>'Youku','scrape'=>[],'tags'=>['.cn']],
147+
'youku'=>['attributes'=>[],'example'=>'https://v.youku.com/v_show/id_XNTE3ODIxMDEzNg==.html','extract'=>['!youku\\.com/v(?:_show|ideo)/id_(?\'id\'\\w+=*)!'],'homepage'=>'https://www.youku.com/','host'=>['youku.com'],'iframe'=>['src'=>'//player.youku.com/embed/{@id}'],'name'=>'Youku','scrape'=>[],'tags'=>['.cn']],
148148
'youmaker'=>['attributes'=>[],'example'=>['https://www.youmaker.com/v/EnDXOWo8OOvQ','https://www.youmaker.com/video/b3ce8457-2cbe-4661-84ec-829fa8fe0754'],'extract'=>['!youmaker\\.com/(?:embed|v(?:ideo)?)/(?\'id\'[-a-z0-9]+)!i'],'homepage'=>'https://www.youmaker.com/','host'=>['youmaker.com'],'iframe'=>['src'=>'https://www.youmaker.com/embed/{@id}'],'name'=>'YouMaker','scrape'=>[],'tags'=>['videos']],
149149
'youtube'=>['amp'=>['custom-element'=>'amp-youtube','src'=>'https://cdn.ampproject.org/v0/amp-youtube-0.1.js','template'=>'<amp-youtube layout="responsive" width="640" height="360" data-param-list="{@list}" data-param-start="{@t}" data-videoid="{@id}"/>'],'attributes'=>['id'=>['filterChain'=>['#identifier'],'required'=>false],'t'=>['filterChain'=>['#timestamp']]],'example'=>['https://www.youtube.com/watch?v=-cEzsCAzTak','https://youtu.be/-cEzsCAzTak','https://www.youtube.com/watch?feature=player_detailpage&v=jofNR_WkoCE#t=40','https://www.youtube.com/watch?v=pC35x6iIPmo&list=PLOU2XLYxmsIIxJrlMIY5vYXAFcO5g83gA'],'extract'=>['!youtube\\.com/(?:watch.*?v=|(?:embed|live|shorts|v)/|attribution_link.*?v%3D)(?\'id\'[-\\w]+)!','!youtube-nocookie\\.com/embed/(?\'id\'[-\\w]+)!','!youtu\\.be/(?\'id\'[-\\w]+)!','@[#&?]t(?:ime_continue)?=(?\'t\'\\d[\\dhms]*)@','![&?]list=(?\'list\'[-\\w]+)!'],'homepage'=>'https://www.youtube.com/','host'=>['youtube-nocookie.com','youtube.com','youtu.be'],'iframe'=>['referrerpolicy'=>'origin','src'=>'https://www.youtube.com/embed/<xsl:value-of select="@id"/><xsl:choose><xsl:when test="@clip">?clip=<xsl:value-of select="@clip"/>&amp;clipt=<xsl:value-of select="@clipt"/></xsl:when><xsl:otherwise><xsl:if test="@list">?list=<xsl:value-of select="@list"/></xsl:if><xsl:if test="@t"><xsl:choose><xsl:when test="@list">&amp;</xsl:when><xsl:otherwise>?</xsl:otherwise></xsl:choose>start=<xsl:value-of select="@t"/></xsl:if></xsl:otherwise></xsl:choose>','style'=>['background'=>'url(https://i.ytimg.com/vi/{@id}/hqdefault.jpg) 50% 50% / cover']],'name'=>'YouTube','oembed'=>['endpoint'=>'https://www.youtube.com/oembed','scheme'=>'https://www.youtube.com/watch?v={@id}'],'scrape'=>[['extract'=>['@/embed/(?\'id\'[-\\w]+)\\?clip=(?\'clip\'[-\\w]+)&amp;clipt=(?\'clipt\'[-\\w]+)@'],'match'=>['@youtube\\.com/clip/.@']]],'source'=>'https://support.google.com/youtube/bin/answer.py?hl=en&answer=171780','tags'=>['livestreaming','videos']]
150150
];

src/Plugins/MediaEmbed/Configurator/sites/youku.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<site name="Youku" homepage="https://www.youku.com/">
2-
<example>https://v.youku.com/v_show/id_XMzY0NTMyMTgxMg==.html</example>
2+
<example>https://v.youku.com/v_show/id_XNTE3ODIxMDEzNg==.html</example>
33

44
<tags><tag>.cn</tag></tags>
55

0 commit comments

Comments
 (0)