HoverHell / RedditImageGrab

Downloads images from sub-reddits of reddit.com.
GNU General Public License v3.0
311 stars 78 forks source link

What values are expected with the [--last l] cli argument? #47

Closed jtara1 closed 8 years ago

jtara1 commented 8 years ago

There's only several lines of code related to this cli arg, and the critical line seems to be:

if previd:
    url = '%s?after=t3_%s' % (url, previd)

where previd is equal to the value passed by the user with the --last arg. So if I was downloading from /r/wallpapers the url would probably look something like this:

https://www.reddit.com/r/wallpapers?after=t3_15

assuming the previd is the reddit index, but I don't think that's a valid url query.

jtara1 commented 8 years ago

Found the answer, the expected value here is the reddit id which can be found with ITEMS[item_index]['id'].

Or since it iterates with

for ITEM in ITEMS:
    ...

access reddit submission/item id with ITEM['id'] I believe.

rachmadaniHaryono commented 8 years ago

i have made more example to readme, so new user will not give the wrong input to '--last' flag.

there is another possibility to process the flag input, so user can give url or thread_id with prefix.

if you have another question you can create new issues.