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

Disable decryption in tests for the native HLS downloader #27660

Merged
merged 2 commits into from
Jan 4, 2021

Conversation

kevinoconnor7
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

Description of your pull request and other information

Tests truncate the download to 10241 bytes, which is not divisible by 16 and cannot be decrypted. Tests don't really care about the decrypted content, just that the data they retrieved is the expected data. Therefore, it's fine to just return the encrypted data to tests.

Currently tests that want to do MD5 verification of the download will encounter the error:

  File "/Users/kevinoconnor/Development/youtube-dl/youtube_dl/downloader/hls.py", line 182, in real_download
    decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(frag_content)
  File "/usr/local/lib/python3.7/site-packages/Crypto/Cipher/blockalgo.py", line 295, in decrypt
    return self._cipher.decrypt(ciphertext)
ValueError: Input strings must be a multiple of 16 in length

See: #27621 and #27620

kevinoconnor7 and others added 2 commits January 4, 2021 13:02
Tests truncate the download to 10241 bytes, which is not divisible by 16
and cannot be decrypted. Tests don't really care about the decrypted
content, just that the data they retrieved is the expected data.
Therefore, it's fine to just return the encrypted data to tests.

See: ytdl-org#27621 and ytdl-org#27620
@dstftw dstftw merged commit 766fcdd into ytdl-org:master Jan 4, 2021
@kevinoconnor7 kevinoconnor7 deleted the disable_aes_in_test branch January 4, 2021 18:24
ThirumalaiK pushed a commit to ThirumalaiK/youtube-dl that referenced this pull request Jan 28, 2021
Tests truncate the download to 10241 bytes, which is not divisible by 16
and cannot be decrypted. Tests don't really care about the decrypted
content, just that the data they retrieved is the expected data.
Therefore, it's fine to just return the encrypted data to tests.

See: ytdl-org#27621 and ytdl-org#27620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants