V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
pc10201
V2EX  ›  Python

yinyuetai.com音悦台 80万数据采集

  •  
  •   pc10201 · Dec 26, 2013 · 8580 views
    This topic created in 4505 days ago, the information mentioned may be changed or developed.
    音悦台是国内最大的高清MV音乐分享平台,也是国内最大的音乐MV视频媒体平台;提供最新、最快、最高清的MV视频资讯,并提供不同格式的高清MV下载,只为让好歌与你随身而行。

    要采集的字段包括URL,标题,播放次数,收藏次数,以及标签

    采集技巧:

    1.mv的id是连续并且递增的,比如http://v.yinyuetai.com/video/833486
    那就从1到833486,当然有一些是不存在的,即404错误,最终采集到83万数据,有82000多是不存在的,10%左右

    2.播放次数,收藏次数在源代码中是看不到的
    是另外加载了一个js文件,即
    http://v.yinyuetai.com/video/video-statis-info?videoId=%s
    %s代表mv的id
    比如
    http://v.yinyuetai.com/video/video-statis-info?videoId=833486

    3.音悦台没有进行采集限制,我开了50个线程,几个小时就采集完了

    采集的数据csv格式下载地址
    http://pan.baidu.com/s/1i3kKh73

    建议用emeditor打开,或者导入到mysql中,用excel打开后果自负哈

    33 replies    1970-01-01 08:00:00 +08:00
    varrily
        1
    varrily  
       Dec 26, 2013
    还以为把mv文件采集出来了
    pc10201
        2
    pc10201  
    OP
       Dec 26, 2013   ❤️ 1
    @varrily 有了url,可以用维棠软件批量下载
    Ansen
        3
    Ansen  
       Dec 26, 2013
    与其数据,我更新关心脚本
    slax
        4
    slax  
       Dec 26, 2013
    我擦... 我会告诉你我就是音悦台的嘛....
    manhere
        5
    manhere  
       Dec 26, 2013
    音悦台那也叫高清....
    chervun
        6
    chervun  
       Dec 26, 2013
    啧啧……
    xujialiang
        7
    xujialiang  
       Dec 26, 2013
    服务器 压力山大啊
    faceair
        8
    faceair  
       Dec 26, 2013
    @slax 莫名的喜感 233333
    dizzy
        9
    dizzy  
       Dec 26, 2013
    @pc10201 LZ,能否看下你写的代码,学习下。
    letitbesqzr
        10
    letitbesqzr  
       Dec 26, 2013
    同想看看代码...python多线程一直掌握的不太好,很多种写法.. 自己写的总控制不好琐。。
    pc10201
        11
    pc10201  
    OP
       Dec 26, 2013
    @letitbesqzr 我没有用锁,就是用了一个队列
    pc10201
        12
    pc10201  
    OP
       Dec 26, 2013
    @dizzy 具体代码就不分享的,基本上就是依照这个代码的思路
    https://github.com/pycurl/pycurl/blob/master/examples/retriever.py
    mechille
        13
    mechille  
       Dec 26, 2013
    @slax
    @faceair 喜感+1.不懂LZ这帖的目的...
    ScotGu
        14
    ScotGu  
       Dec 26, 2013
    @slax 喜感~~ 想知道你的感受。。
    dizzy
        15
    dizzy  
       Dec 26, 2013
    @pc10201 好的。
    csx163
        16
    csx163  
       Dec 26, 2013
    楼主...都是标题啊,当初我可是弄的直接下载地址啊
    tryv2eex
        17
    tryv2eex  
       Dec 26, 2013
    @csx163 @admin 看看
    tryv2eex
        18
    tryv2eex  
       Dec 26, 2013
    v2ex 还是没有哪几个国外网站好 我是说用户体验 忽略上面的回复 只是在try v2ex
    tryv2eex
        19
    tryv2eex  
       Dec 26, 2013
    对了 每次发新帖都要刷新一次页面? 试试
    tryv2eex
        20
    tryv2eex  
       Dec 26, 2013
    好象是的 刷新以后 居然又回到了页面顶端 我用的是Chrome 用用其他浏览器看看
    tryv2eex
        21
    tryv2eex  
       Dec 26, 2013
    Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1141, in _when_complete
    callback()
    File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1162, in _execute_method
    self._when_complete(method(*self.path_args, **self.path_kwargs),
    File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 2293, in wrapper
    return method(self, *args, **kwargs)
    File "/www/v2ex/galaxy/handlers/web/topic.py", line 74, in post
    return self.finalize('topic/newbie.html')
    File "/www/v2ex/galaxy/handlers/web/__init__.py", line 74, in finalize
    o = template.render(self.values)
    File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
    File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
    File "/www/v2ex/galaxy/templates/desktop/topic/newbie.html", line 1, in top-level template code
    {% extends 'desktop/common/layout0.html' %}
    File "/www/v2ex/galaxy/templates/desktop/common/layout0.html", line 63, in top-level template code
    {% block wrapper %}
    File "/www/v2ex/galaxy/templates/desktop/common/layout0.html", line 126, in block "wrapper"
    {% block main %}
    File "/www/v2ex/galaxy/templates/desktop/topic/newbie.html", line 4, in block "main"
    <div class="header">{{ breadcrumb([node.title + ':/go/' + node.name, '创建新主题:/new/' + node.name, '请稍等']) }}</div>
    File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 397, in getattr
    return getattr(obj, attribute)
    UndefinedError: 'node' is undefined
    tryv2eex
        22
    tryv2eex  
       Dec 26, 2013
    刚才v2ex出现了错误 一下子曝光好多信息 python tornado
    Keyes
        23
    Keyes  
       Dec 26, 2013
    @tryv2eex 霍霍霍,tornado才是極品
    binux
        24
    binux  
       Dec 26, 2013
    book.douban.com豆瓣读书 600+万数据采集

    1. id不是连续的,而且id不一定是数的,不过可以根据跳转后的域名是不是book判断
    http://book.douban.com/subject/25785270/

    2. 如何更全地获取全量数据
    由于douban是没有穷举接口的,要获取所有的书很不方便,于是有
    方案一:follow tag列表,但是会经常遇到重复的书,follow的量都快赶上书的量了
    方案二:isbn穷举,从dangdang、amazon、京东商品列表是可以遍历的,通过获取他们的图书信息,获得isbn库,通过 https://api.douban.com/v2/book/isbn/ 接口获得书的地址

    3. 豆瓣有防采集机制,大约每秒1个以上就会被封,早期导致我们的一个IP被封了一年
    解决方案:抓取公开的代理列表,通过代理抓取,多重试
    nimini
        25
    nimini  
       Dec 26, 2013
    无图 你说个JB
    tryv2eex
        26
    tryv2eex  
       Dec 26, 2013
    @没有这个人 会怎么样
    wolegequ
        27
    wolegequ  
       Dec 26, 2013
    @tryv2eex我也曾有过这样的想法 各网站难道支持@功能了么, @功能难到没门槛的吗
    lj0014
        28
    lj0014  
       Dec 27, 2013 via Android
    曾经遍历了豆瓣一亿以内的id...
    milkr
        29
    milkr  
       Dec 27, 2013 via iPhone
    @slax 哈哈
    asca
        30
    asca  
       Dec 27, 2013
    音悦台有水印,清晰度也不高,下载下来也没多大意思。
    slax
        31
    slax  
       Dec 27, 2013
    @milkr 囧... 被爆菊的感脚,哈哈。
    kimcool
        32
    kimcool  
       Dec 27, 2013
    @slax 常在路边走,哪能不湿鞋,哈哈,骂扶凯去
    slax
        33
    slax  
       Dec 31, 2013
    @kimcool 应该把ID也弄成随机字符串...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1481 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 76ms · UTC 17:06 · PVG 01:06 · LAX 10:06 · JFK 13:06
    ♥ Do have faith in what you're doing.