pax_global_header 0000666 0000000 0000000 00000000064 13434577234 0014526 g ustar 00root root 0000000 0000000 52 comment=80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-reddit/ 0000775 0000000 0000000 00000000000 13434577234 0023005 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-reddit/modules/ 0000775 0000000 0000000 00000000000 13434577234 0024455 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-reddit/modules/reddit/ 0000775 0000000 0000000 00000000000 13434577234 0025730 5 ustar 00root root 0000000 0000000 woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-reddit/modules/reddit/__init__.py 0000664 0000000 0000000 00000001560 13434577234 0030043 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from __future__ import unicode_literals
from .module import RedditModule
__all__ = ['RedditModule']
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-reddit/modules/reddit/browser.py 0000664 0000000 0000000 00000004606 13434577234 0027773 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This weboob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this weboob module. If not, see .
from __future__ import unicode_literals
from weboob.browser import PagesBrowser, URL
from .pages import ListPage, SearchPage, EntryPage, CatchHTTP
class RedditBrowser(PagesBrowser):
BASEURL = 'https://www.reddit.com/r/pics/'
listing = URL(r'(?P\w*)/?\?count=\d+&after=(?P\w+)',
r'(?P\w*)/?$',
ListPage)
entry = URL(r'/comments/(?P\w+)/.*', EntryPage)
search = URL(r'search\?sort=(?P\w+)&restrict_sr=on', SearchPage)
# catch-all to avoid BrowserHTTPSDowngrade
catch_http = URL(r'http://.*', CatchHTTP)
def __init__(self, sub, *args, **kwargs):
super(RedditBrowser, self).__init__(*args, **kwargs)
self.BASEURL = 'https://www.reddit.com/r/%s/' % sub
def iter_images(self, cat=''):
self.listing.go(cat=cat)
return self.page.iter_images()
def search_images(self, pattern, sort='top', nsfw=False):
nsfw = {True: 'yes', False: 'no'}[nsfw]
pattern = '%s nsfw:%s' % (pattern, nsfw)
self.search.go(sort=sort, params={'q': pattern})
return self.page.iter_images()
def iter_threads(self, cat=''):
self.listing.go(cat=cat)
return self.page.iter_threads()
def fill_thread(self, thread):
self.location(thread.url, params={'sort': 'old'})
assert self.entry.is_here()
self.page.fill_thread(thread)
def get_thread(self, id):
self.entry.go(id=id, params={'sort': 'old'})
return self.page.get_thread(id)
def get_image(self, id):
self.entry.go(id=id)
img = self.page.get_image()
img.id = id
return img
woob-80d8d4f930af694bb2ce2ffeb7ce41d7e40f45cd-modules-reddit/modules/reddit/favicon.png 0000664 0000000 0000000 00000022640 13434577234 0030067 0 ustar 00root root 0000000 0000000 PNG
IHDR >a bKGD pHYs tIME aS iTXtComment Created with GIMPd.e IDATx}pS?Hl!cC0H$%$B6/MnI[nm wwɶtLvnm:mܴIdn!M$@BcDzd~G7lLz̜X>AT*UJURT*UJURT*U鯜#2+c
\,4L}I
y "I:KuHJw^2zx:@feNx8䊘>e+')W@U 0&i Vd/uG|yJ`_yi>V&c@Qm6hjj"_.chhI$rr-]n`1`8[e{\s5\>`xxA=k/ᅬaC2x/8Fri>!{ef2y3˙~#sժUn/g
?3U4duݼ馛{6'CX|ꩧrT?K*"w4S\d_ʌbTܾ}{%-0|U~
K%fq뭷yfn>s-ʽ^sQti]2 4 rۼy3S^봵Ѐ(֪\kd(ׄH{v$KUGccc9M|>2
#p1`=j.,iid2aSW==={+H5WAAn`-7RۦóFtttp-L3B;vԩSր0@BxQG<Әlg>ɓS f}}}00 *lUN 72RV:}4 -X~A.رc