def test_add_task_by_author(): ids = ''' shi-yidian-ban-98 xbjf zhao-hao-yang-1991 mandelbrot-11 chenqin leng-zhe spto xiepanda cogito xu-zhe-42 huo-zhen-bu-lu-zi-lao-ye cai-tong shu-sheng-4-25 BlackCloak ma-bo-yong hutianyi Metaphox calon ma-qian-zu skiptomylou sinsirius 费寒冬 shinianhanshuang 十年寒霜 youhuiwu 程步一 xie-wei-54-24 # talich # commando # fu-er # tassandar # zhou-xiao-nong # yinshoufu # tangsyau # lianghai ''' for author_id in datalines(ids): # for answer in yield_author_answers(id, limit=3000, min_voteup=100): # url = zhihu_answer_url(answer) # count += 1 # log('<{}> {}'.format(count, url)) # Task.add(url=url) if ' ' in author_id: author_id = author_id | grep_before(' ') log(author_id) Task.add_by_author(author_id, limit=2000, min_voteup=1, stop_at_existed=5, force_start=False)