-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for plain text filenameEnc (#946)
- Loading branch information
1 parent
f93df7b
commit d6ca702
Showing
5 changed files
with
11,880 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2165,3 +2165,41 @@ def test_download_bad_filename_utf8_encoding(self) -> None: | |
|
||
self.assertIsInstance(result.exception, ValueError) | ||
# self.assertEqual(result.exception, ValueError("Invalid Input: b'i\\xb7\\x1dy\\xf8!'")) | ||
|
||
def test_download_filename_string_encoding(self) -> None: | ||
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3]) | ||
|
||
files_to_create = [ | ||
("2018/07/30", "IMG_7408.JPG", 1151066), | ||
("2018/07/30", "IMG_7407.JPG", 656257), | ||
] | ||
|
||
files_to_download: List[Tuple[str, str]] = [ | ||
# SU1HXzc0MDkuSlBH -> IMG_7409.JPG | ||
("2018/07/31", "IMG_7409.JPG") | ||
] | ||
|
||
data_dir, result = run_icloudpd_test( | ||
self.assertEqual, | ||
self.vcr_path, | ||
base_dir, | ||
"listing_photos_filename_string_encoding.yml", | ||
files_to_create, | ||
files_to_download, | ||
[ | ||
"--username", | ||
"[email protected]", | ||
"--password", | ||
"password1", | ||
"--recent", | ||
"5", | ||
"--skip-videos", | ||
"--skip-live-photos", | ||
"--no-progress-bar", | ||
"--threads-num", | ||
"1", | ||
], | ||
) | ||
print_result_exception(result) | ||
|
||
self.assertEqual(result.exit_code, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2153,3 +2153,41 @@ def test_download_bad_filename_utf8_encoding_name_id7(self) -> None: | |
|
||
self.assertIsInstance(result.exception, ValueError) | ||
# self.assertEqual(result.exception, ValueError("Invalid Input: b'i\\xb7\\x1dy\\xf8!'")) | ||
|
||
def test_download_filename_string_encoding_name_id7(self) -> None: | ||
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3]) | ||
|
||
files_to_create = [ | ||
("2018/07/30", "IMG_7408_QVI4T2l.JPG", 1151066), | ||
("2018/07/30", "IMG_7407_QVovd0F.JPG", 656257), | ||
] | ||
|
||
files_to_download: List[Tuple[str, str]] = [ | ||
# SU1HXzc0MDkuSlBH -> IMG_7409.JPG | ||
("2018/07/31", "IMG_7409_QVk2Yyt.JPG") | ||
] | ||
|
||
data_dir, result = run_icloudpd_test( | ||
self.assertEqual, | ||
self.vcr_path, | ||
base_dir, | ||
"listing_photos_filename_string_encoding.yml", | ||
files_to_create, | ||
files_to_download, | ||
[ | ||
"--username", | ||
"[email protected]", | ||
"--password", | ||
"password1", | ||
"--recent", | ||
"5", | ||
"--skip-videos", | ||
"--skip-live-photos", | ||
"--no-progress-bar", | ||
"--file-match-policy", | ||
"name-id7", | ||
], | ||
) | ||
print_result_exception(result) | ||
|
||
self.assertEqual(result.exit_code, 0) |
Oops, something went wrong.