Skip to content

Commit

Permalink
[reddit] fix documentation inconsistencies (closes #429)
Browse files Browse the repository at this point in the history
- Require 'reddit.comments' to be a number and convert it to an
  integer to be extra sure
- Link to the README's OAuth section were appropriate
  • Loading branch information
mikf committed Sep 27, 2019
1 parent 20eb6c4 commit 46ba173
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -603,8 +603,8 @@ extractor.deviantart.refresh-token
=========== =====
Type ``string``
Default ``null``
Description The ``refresh_token`` value you get from linking your
DeviantArt account to *gallery-dl*.
Description The ``refresh_token`` value you get from
`linking your DeviantArt account to gallery-dl <OAuth_>`__.

Using a ``refresh_token`` allows you to access private or otherwise
not publicly available deviations.
Expand Down Expand Up @@ -662,7 +662,7 @@ extractor.flickr.access-token & .access-token-secret
Type ``string``
Default ``null``
Description The ``access_token`` and ``access_token_secret`` values you get
from linking your Flickr account to *gallery-dl*.
from `linking your Flickr account to gallery-dl <OAuth_>`__.
=========== =====


Expand Down Expand Up @@ -830,7 +830,7 @@ Description A list of extractor categories which should be ignored when using
extractor.reddit.comments
-------------------------
=========== =====
Type ``integer`` or ``string``
Type ``integer``
Default ``500``
Description The value of the ``limit`` parameter when loading
a submission and its comments.
Expand All @@ -840,7 +840,7 @@ Description The value of the ``limit`` parameter when loading
Reddit's internal default and maximum values for this parameter
appear to be 200 and 500 respectively.

The value `0` ignores all comments and significantly reduces the
The value ``0`` ignores all comments and significantly reduces the
time required when scanning a subreddit.
=========== =====

Expand Down Expand Up @@ -897,8 +897,8 @@ extractor.reddit.refresh-token
=========== =====
Type ``string``
Default ``null``
Description The ``refresh_token`` value you get from linking your
Reddit account to *gallery-dl*.
Description The ``refresh_token`` value you get from
`linking your Reddit account to gallery-dl <OAuth_>`__.

Using a ``refresh_token`` allows you to access private or otherwise
not publicly available subreddits, given that your account is
Expand Down Expand Up @@ -1863,4 +1863,5 @@ Description An object with the ``name`` of a post-processor and its options.
.. _datetime: https://docs.python.org/3/library/datetime.html#datetime-objects
.. _datetime.max: https://docs.python.org/3/library/datetime.html#datetime.datetime.max
.. _Authentication: https://github.com/mikf/gallery-dl#authentication
.. _OAuth: https://github.com/mikf/gallery-dl#oauth
.. _youtube-dl: https://github.com/ytdl-org/youtube-dl
4 changes: 2 additions & 2 deletions gallery_dl/extractor/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class RedditAPI():

def __init__(self, extractor):
self.extractor = extractor
self.comments = extractor.config("comments", 500)
self.comments = text.parse_int(extractor.config("comments", 500))
self.morecomments = extractor.config("morecomments", False)
self.refresh_token = extractor.config("refresh-token")
self.log = extractor.log
Expand All @@ -191,7 +191,7 @@ def __init__(self, extractor):
self.client_id = None
self.log.warning(
"Conflicting values for 'client-id' and 'user-agent': "
"override either both or none of them.")
"overwrite either both or none of them.")
else:
self.client_id = client_id
extractor.session.headers["User-Agent"] = user_agent
Expand Down

0 comments on commit 46ba173

Please sign in to comment.