Skip to content
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

[afreecatv] Fix adult (19+) VODs #28405

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

[afreecatv] Fix adult (19+) VODs #28405

wants to merge 4 commits into from

Conversation

wlritchi
Copy link
Contributor

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:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

AfreecaTV marks segments of VODs, or entire VODs, as adult content. When
accessing a VOD with adult segments from an underage account or when not
logged in, the first request fails with a "PARTIAL_ADULT" error flag,
and we retry with the partialView=SKIP_ADULT query parameter. This
allows us to download the segments of the video that are not marked as
adult.

Now, when accessing a VOD that is entirely marked as adult content,
the first request fails with an "ADULT" error flag, even if logged in
to an adult account
. The web client presents a click-through warning,
and refetches the XML with adultView=ADULT_VIEW.

This commit adjusts the existing retry logic for PARTIAL_ADULT to also
support retrying ADULT VODs with the required parameter.

If the same ADULT error is returned on the second attempt, we raise the
same error as before. This will occur if we are not logged in to an
adult account.

At this time it does not appear that the click-through warning has been
added to PARTIAL_ADULT VODs, so if we are logged in, our first request
is still successful. Therefore, the PARTIAL_ADULT logic does not need
to be changed.

The VODs mentioned in the below tickets are both now private, so I
cannot test the given URLs, but I believe that this:

Fixes #26622, fixes #26926

AfreecaTV marks segments of VODs, or entire VODs, as adult content. When
accessing a VOD with adult segments from an underage account or when not
logged in, the first request fails with a "PARTIAL_ADULT" error flag,
and we retry with the partialView=SKIP_ADULT query parameter. This
allows us to download the segments of the video that are not marked as
adult.

Now, when accessing a VOD that is entirely marked as adult content,
the first request fails with an "ADULT" error flag, *even if logged in
to an adult account*. The web client presents a click-through warning,
and refetches the XML with adultView=ADULT_VIEW.

This commit adjusts the existing retry logic for PARTIAL_ADULT to also
support retrying ADULT VODs with the required parameter.

If the same ADULT error is returned on the second attempt, we raise the
same error as before. This will occur if we are not logged in to an
adult account.

At this time it does not appear that the click-through warning has been
added to PARTIAL_ADULT VODs, so if we are logged in, our first request
is still successful. Therefore, the PARTIAL_ADULT logic does not need
to be changed.

The VODs mentioned in the below tickets are both now private, so I
cannot test the given URLs, but I believe that this:

Fixes #26622, fixes #26926
pukkandan pushed a commit to yt-dlp/yt-dlp that referenced this pull request Aug 30, 2021
nixxo pushed a commit to nixxo/yt-dlp that referenced this pull request Nov 22, 2021
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