fix miaopai mobile page download

url does not contains .htm
This commit is contained in:
yunair 2017-06-19 14:16:50 +08:00
parent d0a7655727
commit 8e40809446
2 changed files with 12 additions and 5 deletions

View File

@ -57,6 +57,8 @@ def yixia_download(url, output_dir = '.', merge = True, info_only = False, **kwa
scid = match1(url, r'http://www.miaopai.com/show/(.+)\.htm') scid = match1(url, r'http://www.miaopai.com/show/(.+)\.htm')
elif re.match(r'http://m.miaopai.com/show/channel/.+', url): #Mobile elif re.match(r'http://m.miaopai.com/show/channel/.+', url): #Mobile
scid = match1(url, r'http://m.miaopai.com/show/channel/(.+)\.htm') scid = match1(url, r'http://m.miaopai.com/show/channel/(.+)\.htm')
if scid == None :
scid = match1(url, r'http://m.miaopai.com/show/channel/(.+)')
elif 'xiaokaxiu.com' in hostname: #Xiaokaxiu elif 'xiaokaxiu.com' in hostname: #Xiaokaxiu
yixia_download_by_scid = yixia_xiaokaxiu_download_by_scid yixia_download_by_scid = yixia_xiaokaxiu_download_by_scid

View File

@ -2,12 +2,10 @@
import unittest import unittest
from you_get import *
from you_get.extractors import * from you_get.extractors import *
from you_get.common import *
class YouGetTests(unittest.TestCase): class YouGetTests(unittest.TestCase):
def test_imgur(self): def test_imgur(self):
imgur.download("http://imgur.com/WVLk5nD", info_only=True) imgur.download("http://imgur.com/WVLk5nD", info_only=True)
imgur.download("http://imgur.com/gallery/WVLk5nD", info_only=True) imgur.download("http://imgur.com/gallery/WVLk5nD", info_only=True)
@ -18,4 +16,11 @@ class YouGetTests(unittest.TestCase):
def test_youtube(self): def test_youtube(self):
youtube.download("http://www.youtube.com/watch?v=pzKerr0JIPA", info_only=True) youtube.download("http://www.youtube.com/watch?v=pzKerr0JIPA", info_only=True)
youtube.download("http://youtu.be/pzKerr0JIPA", info_only=True) youtube.download("http://youtu.be/pzKerr0JIPA", info_only=True)
youtube.download("http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare", info_only=True) youtube.download("http://www.youtube.com/attribution_link?u=/watch?v%3DldAKIzq7bvs%26feature%3Dshare",
info_only=True)
def test_yixia(self):
yixia_download("http://m.miaopai.com/show/channel/vlvreCo4OZiNdk5Jn1WvdopmAvdIJwi8", info_only=True)
if __name__ == '__main__':
unittest.main()