<s> from lixian_plugins . api import page_parser <EOL> import urllib2 <EOL> import re <EOL> def parse_links ( html ) : <EOL> html = re . search ( r'<STR_LIT>' , html , re . S ) . group ( ) <EOL> links = re . findall ( r'<STR_LIT>' , html ) <EOL> return [ x for x in links if x . startswith ( '<STR_LIT>' ) ] <EOL> def verycd_links ( url ) : <EOL> assert url . startswith ( '<STR_LIT>' ) , url <EOL> return parse_links ( urllib2 . urlopen ( url ) . read ( ) ) <EOL> @ page_parser ( '<STR_LIT>' ) <EOL> def extend_link ( url ) : <EOL> links = verycd_links ( url ) <EOL> from lixian_hash_ed2k import parse_ed2k_file <EOL> return [ { '<STR_LIT:url>' : x , '<STR_LIT:name>' : parse_ed2k_file ( x ) } for x in links ] </s>
