From 19daf26c088c9259f13f2c54e563534b62ef4945 Mon Sep 17 00:00:00 2001 From: Henrik Hank Date: Wed, 16 May 2018 02:58:57 +0200 Subject: [PATCH] `flake8` compatibility. --- test/test_utils.py | 16 ++++++++-------- youtube_dl/YoutubeDL.py | 9 ++++++--- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/test/test_utils.py b/test/test_utils.py index f377e6405..efe354477 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1338,28 +1338,28 @@ Line 1 def test_iri_to_uri(self): self.assertEqual( iri_to_uri('https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8&client=firefox-b'), - 'https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8&client=firefox-b') # Same + 'https://www.google.com/search?q=foo&ie=utf-8&oe=utf-8&client=firefox-b') # Same self.assertEqual( iri_to_uri('https://www.google.com/search?q=Käsesoßenrührlöffel'), # German for cheese sauce stirring spoon - 'https://www.google.com/search?q=K%C3%A4seso%C3%9Fenr%C3%BChrl%C3%B6ffel') + 'https://www.google.com/search?q=K%C3%A4seso%C3%9Fenr%C3%BChrl%C3%B6ffel') self.assertEqual( iri_to_uri('https://www.google.com/search?q=lt<+gt>+eq%3D+amp%26+percent%25+hash%23+colon%3A+tilde~#trash=?&garbage=#'), - 'https://www.google.com/search?q=lt%3C+gt%3E+eq%3D+amp%26+percent%25+hash%23+colon%3A+tilde~#trash=?&garbage=#') + 'https://www.google.com/search?q=lt%3C+gt%3E+eq%3D+amp%26+percent%25+hash%23+colon%3A+tilde~#trash=?&garbage=#') self.assertEqual( iri_to_uri('http://правозащита38.рф/category/news/'), - 'http://xn--38-6kcaak9aj5chl4a3g.xn--p1ai/category/news/') + 'http://xn--38-6kcaak9aj5chl4a3g.xn--p1ai/category/news/') self.assertEqual( iri_to_uri('http://www.правозащита38.рф/category/news/'), - 'http://www.xn--38-6kcaak9aj5chl4a3g.xn--p1ai/category/news/') + 'http://www.xn--38-6kcaak9aj5chl4a3g.xn--p1ai/category/news/') self.assertEqual( iri_to_uri('https://i❤.ws/emojidomain/👍👏🤝💪'), - 'https://xn--i-7iq.ws/emojidomain/%F0%9F%91%8D%F0%9F%91%8F%F0%9F%A4%9D%F0%9F%92%AA') + 'https://xn--i-7iq.ws/emojidomain/%F0%9F%91%8D%F0%9F%91%8F%F0%9F%A4%9D%F0%9F%92%AA') self.assertEqual( iri_to_uri('http://日本語.jp/'), - 'http://xn--wgv71a119e.jp/') + 'http://xn--wgv71a119e.jp/') self.assertEqual( iri_to_uri('http://导航.中国/'), - 'http://xn--fet810g.xn--fiqs8s/') + 'http://xn--fet810g.xn--fiqs8s/') if __name__ == '__main__': diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 98d4e58ee..24b660f93 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1887,11 +1887,14 @@ class YoutubeDL(object): return True if url_link: - if not _write_link_file('url', URL_LINK_TEMPLATE, '\r\n', embed_filename=False): return + if not _write_link_file('url', URL_LINK_TEMPLATE, '\r\n', embed_filename=False): + return if webloc_link: - if not _write_link_file('webloc', WEBLOC_LINK_TEMPLATE, '\n', embed_filename=False): return + if not _write_link_file('webloc', WEBLOC_LINK_TEMPLATE, '\n', embed_filename=False): + return if desktop_link: - if not _write_link_file('desktop', DESKTOP_LINK_TEMPLATE, '\n', embed_filename=True ): return + if not _write_link_file('desktop', DESKTOP_LINK_TEMPLATE, '\n', embed_filename=True): + return if self.params.get('skip_download', False): # Regarding the download archive, consider internet shortcut creation in conjunction with the `--skip-download` switch as everything the user wants. (See also help for the`--download-archive` switch.)