code adjustments according to pep8 nr2

This commit is contained in:
Mike Fährmann
2017-02-01 00:53:19 +01:00
parent f1b7d41608
commit 94e10f249a
68 changed files with 390 additions and 167 deletions

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2015, 2016 Mike Fährmann
# Copyright 2015-2017 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -11,13 +11,15 @@
from .common import Extractor, Message
from .. import text, exception
class ImgurAlbumExtractor(Extractor):
"""Extractor for image albums from imgur.com"""
category = "imgur"
subcategory = "album"
directory_fmt = ["{category}", "{album-key} - {title}"]
filename_fmt = "{category}_{album-key}_{num:>03}_{hash}{ext}"
pattern = [r"(?:https?://)?(?:m\.|www\.)?imgur\.com/(?:a|gallery)/([^/?&#]+)"]
pattern = [r"(?:https?://)?(?:m\.|www\.)?imgur\.com/"
r"(?:a|gallery)/([^/?&#]+)"]
test = [
("https://imgur.com/a/TcBmP", {
"url": "ce3552f550a5b5316bd9c7ae02e21e39f30c0563",
@@ -56,8 +58,8 @@ class ImgurAlbumExtractor(Extractor):
def get_images(self):
"""Return a list of all images in this album"""
url = ("https://imgur.com/ajaxalbums/getimages/"
+ self.album + "/hit.json")
url = ("https://imgur.com/ajaxalbums/getimages/" +
self.album + "/hit.json")
data = self.request(url).json()["data"]
if not data:
raise exception.NotFoundError("album")