-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pornflip] extractor update Closes:#18485 #21169
Conversation
Change the way the website is parsed and how the data is presented to YouTubeDl.
Thanks for closing this PR by modifying utils.py (strip_or_none()) and commons.py to get pornflip to work again. I have tested the three URL formats of pornflip.com and the latest state of youtube-dl at master works for all three cases (but with different media names as per the different header and URL formats.) Could you also consider looking at my other submission in this PR? |
Hi @dstftw , tl,dr
On pornflip the I have looked at this change one more time, and there is a small bug I would like to draw your attention to. It occurs when the video in question is available also as a HD video. Take this video It's video element appears as follows (modified a bit so it is easier to read): <video class="mediaPlayer" id="mediaPlayer"
src=" https://cdn-eu-v1.userscontent.net/dash2/123/3369/1051c532ba16ac5e2c51fe5f4f1d571a.mp4/manifest.mpd?seclink=2FMe0PXTcEcRaLvNfsTw2w&sectime=1559225523"
data-src="https://vs19.userscontent.net/dash/1233369/manifest.mpd?seclink=uUwQ7XxPXq9U5DmTJth3oA&sectime=1559225523"
data-src360="https://cdn-eu-v1.userscontent.net/dash2/123/3369/1051c532ba16ac5e2c51fe5f4f1d571a.mp4/manifest.mpd?seclink=2FMe0PXTcEcRaLvNfsTw2w&sectime=1559225523"
data-src720="https://cdn-eu-v1.userscontent.net/dash2/123/3369/a9acf8ac3fc5b3f2ed8bddfa6f50hd4b.mp4/manifest.mpd?seclink=YY0BmMTMFTNx2noziN90sA&sectime=1559225523"
data-vast-url="https://syndication.exosrv.com/splash.php?idzone=3109786" data-vast-impr-start="/ads/banner?please_no_web_redirect&banners[]=22" data-vast-impr-shown="/ads/banner?please_no_web_redirect&banners[]=-220"
--
| data-matrix="https://img1.pornflip.com/thumbs/123/1233369/" data-embed="https://www.pornflip.com/embed/BETFpNCrhOR" data-link="https://www.pornflip.com/v/BETFpNCrhOR"
| data-id="611799"
| data-proto="https" data-related="https://www.pornflip.com/api/get_related_videos/611799"
| data-qualities="360\|480\|720" data-qualities-convert="" data-version="1"></video> As can be seen, there are several media presentation descriptions (mpds) with attributes:
Closer inspection shows that
In fact for this video, <?xml version="1.0"?>
<MPD
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
type="static"
mediaPresentationDuration="PT2270.333S"
minBufferTime="PT4S"
profiles="urn:mpeg:dash:profile:isoff-main:2011">
<Period>
<AdaptationSet
id="1"
segmentAlignment="true"
maxWidth="480"
maxHeight="272"
maxFrameRate="24">
<SegmentTemplate
timescale="1000"
media="https://cdn-eu-v1.userscontent.net/dash2/123/3369/1051c532ba16ac5e2c51fe5f4f1d571a.mp4/fragment-$Number$-$RepresentationID$.m4s"
initialization="https://cdn-eu-v1.userscontent.net/dash2/123/3369/1051c532ba16ac5e2c51fe5f4f1d571a.mp4/init-$RepresentationID$.mp4"
startNumber="1">
<SegmentTimeline>
<S d="3500"/>
<S d="4000" r="565"/>
<S d="2833"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation
id="v1-x3"
mimeType="video/mp4"
codecs="avc1.4d4015"
width="480"
height="272"
frameRate="24"
sar="1:1"
startWithSAP="1"
bandwidth="352652">
</Representation>
</AdaptationSet>
<AdaptationSet
id="2"
segmentAlignment="true">
<AudioChannelConfiguration
schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
value="1"/>
<SegmentTemplate
timescale="1000"
media="https://cdn-eu-v1.userscontent.net/dash2/123/3369/1051c532ba16ac5e2c51fe5f4f1d571a.mp4/fragment-$Number$-$RepresentationID$.m4s"
initialization="https://cdn-eu-v1.userscontent.net/dash2/123/3369/1051c532ba16ac5e2c51fe5f4f1d571a.mp4/init-$RepresentationID$.mp4"
startNumber="1">
<SegmentTimeline>
<S d="3500"/>
<S d="4000" r="565"/>
<S d="2692"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation
id="a1-x3"
mimeType="audio/mp4"
codecs="mp4a.40.2"
audioSamplingRate="44100"
startWithSAP="1"
bandwidth="127938">
</Representation>
</AdaptationSet>
</Period>
</MPD>
<?xml version="1.0"?>
<MPD
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
type="static"
mediaPresentationDuration="PT2270.333S"
minBufferTime="PT4S"
profiles="urn:mpeg:dash:profile:isoff-main:2011">
<Period>
<AdaptationSet
id="1"
segmentAlignment="true"
maxWidth="1280"
maxHeight="720"
maxFrameRate="24">
<SegmentTemplate
timescale="1000"
media="https://vs19.userscontent.net/dash/1233369/fragment-$Number$-$RepresentationID$.m4s"
initialization="https://vs19.userscontent.net/dash/1233369/init-$RepresentationID$.mp4"
duration="4000"
startNumber="1">
</SegmentTemplate>
<Representation
id="f1-v1-x3"
mimeType="video/mp4"
codecs="avc1.4d4015"
width="480"
height="272"
frameRate="24"
sar="1:1"
startWithSAP="1"
bandwidth="352652">
</Representation>
<Representation
id="f2-v1-x3"
mimeType="video/mp4"
codecs="avc1.4d401e"
width="640"
height="360"
frameRate="24"
sar="1:1"
startWithSAP="1"
bandwidth="977688">
</Representation>
<Representation
id="f3-v1-x3"
mimeType="video/mp4"
codecs="avc1.4d401f"
width="1280"
height="720"
frameRate="24"
sar="1:1"
startWithSAP="1"
bandwidth="1697896">
</Representation>
</AdaptationSet>
<AdaptationSet
id="2"
segmentAlignment="true">
<AudioChannelConfiguration
schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
value="1"/>
<SegmentTemplate
timescale="1000"
media="https://vs19.userscontent.net/dash/1233369/fragment-$Number$-$RepresentationID$.m4s"
initialization="https://vs19.userscontent.net/dash/1233369/init-$RepresentationID$.mp4"
duration="4000"
startNumber="1">
</SegmentTemplate>
<Representation
id="f1-a1-x3"
mimeType="audio/mp4"
codecs="mp4a.40.2"
audioSamplingRate="44100"
startWithSAP="1"
bandwidth="127938">
</Representation>
</AdaptationSet>
</Period>
</MPD>
<?xml version="1.0"?>
<MPD
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
type="static"
mediaPresentationDuration="PT2270.333S"
minBufferTime="PT4S"
profiles="urn:mpeg:dash:profile:isoff-main:2011">
<Period>
<AdaptationSet
id="1"
segmentAlignment="true"
maxWidth="1280"
maxHeight="720"
maxFrameRate="24">
<SegmentTemplate
timescale="1000"
media="https://cdn-eu-v1.userscontent.net/dash2/123/3369/a9acf8ac3fc5b3f2ed8bddfa6f50hd4b.mp4/fragment-$Number$-$RepresentationID$.m4s"
initialization="https://cdn-eu-v1.userscontent.net/dash2/123/3369/a9acf8ac3fc5b3f2ed8bddfa6f50hd4b.mp4/init-$RepresentationID$.mp4"
startNumber="1">
<SegmentTimeline>
<S d="3500"/>
<S d="4000" r="565"/>
<S d="2833"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation
id="v1-x3"
mimeType="video/mp4"
codecs="avc1.4d401f"
width="1280"
height="720"
frameRate="24"
sar="1:1"
startWithSAP="1"
bandwidth="1697896">
</Representation>
</AdaptationSet>
<AdaptationSet
id="2"
segmentAlignment="true">
<AudioChannelConfiguration
schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"
value="1"/>
<SegmentTemplate
timescale="1000"
media="https://cdn-eu-v1.userscontent.net/dash2/123/3369/a9acf8ac3fc5b3f2ed8bddfa6f50hd4b.mp4/fragment-$Number$-$RepresentationID$.m4s"
initialization="https://cdn-eu-v1.userscontent.net/dash2/123/3369/a9acf8ac3fc5b3f2ed8bddfa6f50hd4b.mp4/init-$RepresentationID$.mp4"
startNumber="1">
<SegmentTimeline>
<S d="3500"/>
<S d="4000" r="565"/>
<S d="2692"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation
id="a1-x3"
mimeType="audio/mp4"
codecs="mp4a.40.2"
audioSamplingRate="44100"
startWithSAP="1"
bandwidth="127938">
</Representation>
</AdaptationSet>
</Period>
</MPD> This means to be able to get the best video on the site you have to change from using the |
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
pornflip.py is broken because the website changed. It is currently doing only dash video.
This is an update of the original extractor to get pornflip to work again.
At this time, since all the videos on the site are multipart dash files, none of the tests work, however, the code works as tested as below: