Zdravím bajkeri, včera som si spravil skriptík čo mi stiahne obrázky z jednej témy na fóre. Na začiatku to bola len škaredá konzolovka, ale pár hodín som nad tým posedel a už to vyzerá celkom použiteľne.
Príloha:
2014-10-13_024251.png
2014-10-13_024251.png 7.02 KiB thumb_up0thumb_down


Dnes som to dokončil na 90%, idem už spať. Zajtra večer bude v1.0 :)
13.10.2014 - 02:47:57
03
Paráda. Snáď to bude public licence :P
13.10.2014 - 11:33:09
00
Dokončil som to do stavu že sa to dá ako-tak použiť, ale nie je to príliš blbuvzdorné :) Tak tam treba dávať link naozaj na prvú stranu témy ako je napríklad tento:
Kód:
http://forum.mtbiker.sk/o-hocicom/fotky-bez-zaradenia-t28190.html

Treba mať nainštalovaný Python https://www.python.org/downloads/windows/
Funguje na Pythone 2 aj 3. Bugy mi môžte napísať do správy.

Prílohy:

Mtbiker Pic Downloader.zip [2.34 KiB]

14.10.2014 - 17:17:49
00
Kód:
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
  File "./Mtbiker-Pic-Downloader.py", line 189, in stiahnutobrazky
    obrazok = urlopen(u).read()
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 439, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 626, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 439, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 626, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 439, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 626, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 439, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 626, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 439, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 616, in http_error_302
    self.inf_msg + msg, headers, fp)
HTTPError: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Found

stiahne par obrazkov a "ukazovatel" sa zasekne asi v 2/3.
link bol http://forum.mtbiker.sk/o-hocicom/vasa-vysnivana-zenska-t15364.html :)
strana 200-200. skusil som stranu 301 a stiahlo ju bez problemov.

ps: chcelo by to nejaky exit status na konci, aby clovek vedel, ci to skoncilo, resp. ako (uspesne, neuspesne...)
15.10.2014 - 00:36:44
02
To je kvôli ochrane proti pornu. ;)
15.10.2014 - 16:00:21
04
To sú detaily chlapci... Úspech je že to iba zastaví a nespadne to celé :D Ja som skúsil dať ťahať 100 strán z Fotiek bez zaradenia, zastavilo mi to po 409. fotke lebo server mi poslal 403: Acess denied. Ak budem mať čas tak tam dorobím nejaké tie číselká a resume keď to crashne.
15.10.2014 - 16:42:39
00
keyboard_arrow_up