Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: wwqgtxx <[email protected]>
  • Loading branch information
wwqgtxx committed Jun 24, 2016
1 parent 951c73e commit bfff70e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions wwqLyParse/parsers/anypageparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def Parse(self,input_text,types=None):
global TWICE_PARSE_TIMEOUT
if (types is not None) and ("collection" not in types):
return
if (re.search('www.iqiyi.com/(lib/m|a_|v_)',input_text)):
return
html = PyQuery(getUrl(input_text))
items = html('a')
title = html('title').text()
Expand Down
2 changes: 2 additions & 0 deletions wwqLyParse/parsers/iqiyiparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ def getInfo(self,url):


def Parse(self,input_text,types=None):
if (re.search('www.iqiyi.com/(lib/m|a_)',input_text)):
return
if (types is None) or ("formats" in types):
self.init()
data = {
Expand Down
4 changes: 2 additions & 2 deletions wwqLyParse/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def debug(input):

def main():
debug(GetVersion(debug=True))
#debug(Parse('http://www.iqiyi.com/lib/m_209445514.html?src=search'))
debug(Parse('http://www.iqiyi.com/lib/m_209445514.html?src=search'))
#debug(Parse('http://www.iqiyi.com/a_19rrhacdwt.html#vfrm=2-4-0-1'))
#debug(Parse('http://www.iqiyi.com/a_19rrhaare5.html'))
#debug(Parse('http://www.iqiyi.com/a_19rrhbhf6d.html#vfrm=2-3-0-1'))
Expand All @@ -136,7 +136,7 @@ def main():
#debug(Parse('http://list.iqiyi.com/www/2/----------------iqiyi--.html'))
#debug(Parse('http://www.iqiyi.com/a_19rrhb8fjp.html',"list"))
#debug(Parse('http://www.iqiyi.com/v_19rrl8pmn8.html#vfrm=2-3-0-1'))
debug(Parse('http://www.iqiyi.com/v_19rrl8pmn8.html',"formats"))
#debug(Parse('http://www.iqiyi.com/v_19rrl8pmn8.html',"formats"))
#debug(Parse('http://www.iqiyi.com/v_19rrl8pmn8.html'))
#debug(ParseURL("http://www.iqiyi.com/v_19rrl8pmn8.html","4_fullhd_全高清_895.21 MB@youget"))
#debug(ParseURL("http://www.iqiyi.com/v_19rrl8pmn8.html","4_1080p_1920x1080_2746.0kbps_44:30.660_7_flv_@lyppv"))
Expand Down
4 changes: 2 additions & 2 deletions wwqLyParse/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

if __name__ == "__main__":
import parsers.iqiyiparser
#print(parsers.iqiyiparser.IQiYiParser().Parse("http://www.iqiyi.com/v_19rrl8pmn8.html"))
print(parsers.iqiyiparser.IQiYiParser().ParseURL("http://www.iqiyi.com/v_19rrl8pmn8.html","fullhd"))
print(parsers.iqiyiparser.IQiYiParser().Parse("http://www.iqiyi.com/a_19rrhacdwt.html"))
#print(parsers.iqiyiparser.IQiYiParser().ParseURL("http://www.iqiyi.com/v_19rrl8pmn8.html","fullhd"))
6 changes: 3 additions & 3 deletions wwqLyParse/urlhandles/postfixurlhandle.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class PostfixUrlHandle(UrlHandle):
filters = ['^(http|https)://[^\s]+/[^\s]+\.[s]{0,1}html(\?|#)[^\s]+']

def urlHandle(self,url):
def getUrl(queue,url):
def _getUrl(queue,url):
queue.put(getUrl(url))
result = re.match('^(http|https)://[^\s]+/[^\s]+\.[s]{0,1}html',url).group()
q_results = queue.Queue()
htmls = []
t1 = threading.Thread(target=getUrl, args=(q_results, url))
t2 = threading.Thread(target=getUrl, args=(q_results, result))
t1 = threading.Thread(target=_getUrl, args=(q_results, url))
t2 = threading.Thread(target=_getUrl, args=(q_results, result))
t1.start()
t2.start()
t1.join()
Expand Down

0 comments on commit bfff70e

Please sign in to comment.