rkfg / locmechan

Local metachan to incrementally save threads with pics'n'thumbs as they grow.
GNU General Public License v3.0
6 stars 4 forks source link

locmechan опять падает #5

Open ptah-alexs opened 12 years ago

ptah-alexs commented 12 years ago

Checking http://2ch.so/sf/res/12351.html - no updates Checking http://2ch.so/sf/res/17535.html - 1 new posts Adding post #21260 (0 left) Traceback (most recent call last): File "./grab.py", line 336, in commands[sys.argv[1]]() File "./grab.py", line 125, in get output_writer.add_post(newpost) File "/var/www/locmechan/output.py", line 40, in add_post if not 'postnumber' in post: TypeError: argument of type 'NoneType' is not iterable

ptah-alexs commented 12 years ago

после обновления вот такая картина:

Checking http://2ch.so/sci/res/71671.html - 1 new posts Adding post #93685 (0 left) Traceback (most recent call last): File "./grab.py", line 336, in commands[sys.argv[1]]() File "./grab.py", line 124, in get newpost = _activeparser.get_post(post) File "/var/www/locmechan/parsers/wakaba.py", line 78, in get_post _basetag = self.source.xpath('//td[@id= + postNumber + ]') File "lxml.etree.pyx", line 1447, in lxml.etree._Element.xpath (src/lxml/lxml.etree.c:41728) File "xpath.pxi", line 321, in lxml.etree.XPathElementEvaluator.call (src/lxml/lxml.etree.c:117734) File "xpath.pxi", line 239, in lxml.etree._XPathEvaluatorBase._handle_result (src/lxml/lxml.etree.c:116911) File "xpath.pxi", line 225, in lxml.etree._XPathEvaluatorBase._raise_eval_error (src/lxml/lxml.etree.c:116780) lxml.etree.XPathEvalError: Invalid expression

etw commented 12 years ago

Пофиксила в 69e8ab2d4e1dcfa141b4fcc9dfed5915178806c1

ptah-alexs commented 12 years ago

etw - после твоего патча locmechan не падает, но не сохраняет текст. Пример: http://rghost.ru/37460495

etw commented 12 years ago

Вот пока что однострочник

for i in $(cat list); do
   NAME=$(printf "pirach_%s_%s\n" $(echo $i | cut -d\/ -f4) $(echo $i | cut -d\/ -f6 | cut -d\. -f1))
   rm -fr threads/images/$NAME threads/thumbs/$NAME threads/$NAME.html
done

Как выкачу фикс (уже написан), примени (из корня каталога с локмечаном) однострочник и перекачай треды заново.

ptah-alexs commented 12 years ago

OK, теперь все в норме, спасибо etw

ptah-alexs commented 12 years ago

Снова что-то сбоит:

Checking http://2ch.so/b/res/26949090.html - thread died. Checking http://2ch.so/b/res/26971075.htmlTraceback (most recent call last): File "./grab.py", line 336, in commands[sys.argv[1]]() File "./grab.py", line 115, in get _toDownload.sort(cmp = lambda x,y: int(x) - int(y)) # make strict post order File "./grab.py", line 115, in _toDownload.sort(cmp = lambda x,y: int(x) - int(y)) # make strict post order ValueError: invalid literal for int() with base 10: ''

etw commented 12 years ago

Гм. У меня ща норм все фетчится. Ревизия из гита последняя?

ptah-alexs commented 12 years ago

Как оказалось у меня не последняя ревизия была. Сейчас все нормально

ptah-alexs commented 12 years ago

Хотя он теперь странно сохраняет. В одном из тредов он вместо текста всех постов записал текст последнего поста (пик: http://rghost.ru/37648216/image.png ), в остальных случаях сохраняет посты, но без текста.