QQ空间说说 视频播放

Wesley13
• 阅读 946

http://182.254.8.83/vwecam.gtimg.com/1006\_d81d60f3c83844a5ad6a184149d4ccbb.f0.mp4?sha=78A27CF4908AB546C4ED08708B57168D62190991&ptype=http&amp%3bvkey=F164A3A5C6358B4A5B0EDAEE4A9F2BFD7D12A99F8D0B632A1F50E6DA9634DDCA7E8D97D47F674CD161E1C14190324B27AC0EF147F2AB27FE&amp%3bsdtfrom=v1000&amp%3bowner=3154028129&ocid=1291850924&ocid=3775189258

<a class="img-item  " data-cmd="qz_popup" href="https://user.qzone.qq.com/3154028129/311/1006_fe0b209c194c44dca48c1a8e5fd4ccbb" data-v_itemid="1006_fe0b209c194c44dca48c1a8e5fd4ccbb" data-v_type="1" data-v_picinfo_url="https://b244.photo.store.qq.com/psb?/V10EoZxv3I7ltU/bDCXj4CDH6Rzc0H8OXVcb7o2v.JLtMXICXNA5VUGwU0!/c/dPQAAAAAAAAA&amp;bo=gAJwAQAAAAARF9M!" data-v_picinfo_width="480" data-v_picinfo_height="276" data-v_vidiourl="" data-v_vidioswfurl="http://vwecam.gtimg.com/1006_fe0b209c194c44dca48c1a8e5fd4ccbb.f0.mp4?ptype=http&amp;vkey=6E57E873130938EDA40637E14C2C82503BC1835CDD1BF14AD7ECB95F648A9BB9E1DBB80525036F753803A2F7DF1F13BFDC54F51BA5242F54&amp;sdtfrom=v1000&amp;owner=3154028129" data-v_h265="" data-v_source_website="" data-v_writefrom="" data-videotype="mood" data-clicklog="video" hotclickpath="" hotdomain="" data-version="3" data-param="3&amp;videosrc=http%3A%2F%2Fvwecam.gtimg.com%2F1006_fe0b209c194c44dca48c1a8e5fd4ccbb.f0.mp4%3Fptype%3Dhttp%26vkey%3D6E57E873130938EDA40637E14C2C82503BC1835CDD1BF14AD7ECB95F648A9BB9E1DBB80525036F753803A2F7DF1F13BFDC54F51BA5242F54%26sdtfrom%3Dv1000%26owner%3D3154028129&amp;type=1&amp;org_vidio_url=" data-src="/qzone/app/mood/richinfo_view.html" data-width="512" data-height="512" data-type="popup" data-title="" data-config="" data-extendinfo1="" data-extendinfo2="" data-extendinfo3="" data-extendinfo4="" data-vfeed-id="vfeed_3154028129_311_61a6febb83fc6a5a825f0700_" data-newplayer="1" data-newplayer-id="vfeed_3154028129_311_61a6febb83fc6a5a825f0700_" style="background-color: rgb(0, 0, 0); width: 560px; height: 322px;"><div class="video-img j-videofeed-imgctn" style="width: 560px; height: 322px;"><img src="http://b244.photo.store.qq.com/psb?/V10EoZxv3I7ltU/bDCXj4CDH6Rzc0H8OXVcb7o2v.JLtMXICXNA5VUGwU0!/c/dPQAAAAAAAAA&amp;bo=gAJwAQAAAAARF9M!" data-oriwidth="640" data-oriheight="368" style="width: 560px; height: 322px; margin: 0px;"><i class="ui-icon icon-media-play j-videofeed-icon-play" style="display: none;"></i><span class="video-loading j-videofeed-icon-loading" style="display: none;"><i class="inner"></i></span></div><div style="position: absolute; left: 0px; top: 0px; width: 560px; height: 322px; overflow: hidden;" class="j-videofeed-flashctn" data-need_hide_when_inited="1" data-vpjs-video-id="1516968272464"><div style="width: 100%; height: 100%; overflow: hidden; background-color: rgb(0, 0, 0); position: relative; top: 0px; left: 0px;" id="vpjs-playerContainer-1516968272464" data-vpjs-video-id="1516968272464" class="vpjs-playerContainer"><div id="vpjs-videoContainer-1516968272464" style="width: 100%; height: 100%; position: relative; z-index: 0;">
            <video id="vpjs-video-1516968272464" webkit-playsinline="true" playsinline="true" x-webkit-airplay="true" muted="muted" autoplay="" preload="auto" src="http://vwecam.gtimg.com/1006_fe0b209c194c44dca48c1a8e5fd4ccbb.f0.mp4?ptype=http&amp;vkey=6E57E873130938EDA40637E14C2C82503BC1835CDD1BF14AD7ECB95F648A9BB9E1DBB80525036F753803A2F7DF1F13BFDC54F51BA5242F54&amp;sdtfrom=v1000&amp;owner=3154028129" style="width: 100%; height: auto; margin-top: 0%; position: absolute; left: 0; top: 0">
                <source src="http://vwecam.gtimg.com/1006_fe0b209c194c44dca48c1a8e5fd4ccbb.f0.mp4?ptype=http&amp;vkey=6E57E873130938EDA40637E14C2C82503BC1835CDD1BF14AD7ECB95F648A9BB9E1DBB80525036F753803A2F7DF1F13BFDC54F51BA5242F54&amp;sdtfrom=v1000&amp;owner=3154028129"> 
                Your browser does not support the video tag.
            </video> 
        </div><div id="vpjs-videoPoster-1516968272464" style="display: none;">            <div style="background:url(http://b244.photo.store.qq.com/psb?/V10EoZxv3I7ltU/bDCXj4CDH6Rzc0H8OXVcb7o2v.JLtMXICXNA5VUGwU0!/c/dPQAAAAAAAAA&amp;bo=gAJwAQAAAAARF9M!) no-repeat center;
                background-size: contain;
                position: absolute;
                top: 0;
                left: 0;
                bottom: 0;
                right: 0;">
        </div></div><div id="vpjs-videoMask-1516968272464">    <div style="top: 0; left: 0; bottom: 0; position: absolute; right: 0;"></div></div><div id="vpjs-videoControlBar-1516968272464" class="vpjs-videoControlBar vpjs-fade vpjs-fadein" style="position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; display: block;">
<div class="vpjs-controls">
    <div class="vpjs-controls-bottom">
        <!-- 直播进度 S-->
        <div class="vpjs-progress-pane">
            <div class="vpjs-controls-progress">
                <div class="vpjs-progress-bar" style="width: 540px;">
                    <i class="vpjs-ui-icon vpjs-progress-icon-pointer"></i>
                </div>
            </div>
        </div>
        
        <div class="vpjs-controls-time">
            <!-- 播放按钮 -->
            <i class="vpjs-ui-icon vpjs-icon-play"></i>
            <span class="vpjs-time">
                <b class="j-cur-time-text">00:10</b>/<span class="j-total-time-text">00:10</span>
            </span>
        </div>
        <div class="vpjs-controls-other">        <div class="vpjs-controls-btn vpjs-left">    <i class="vpjs-ui-icon vpjs-icon-fullscreen"></i></div><div class="vpjs-controls-btn vpjs-left">    <i class="vpjs-ui-icon vpjs-icon-silence j-voice-icon"></i>
    <div class="vpjs-voice-progress" style="visibility: hidden;">
        <div class="vpjs-progress-bar j-voice-progress-bar" style="height: 8px;">
            <i class="vpjs-ui-icon vpjs-voice-icon-pointer"></i>
        </div>
    </div></div></div>
    </div>

</div>
<div class="control-tips" style="display: none;">点击查看更多</div></div><div id="vpjs-videoLoading-1516968272464" style="display: none;">            <div style="background: url(//qzonestyle.gtimg.cn/aoi/img/video-loading-bg.png) no-repeat center;
                background-size: cover;
                width: 40px;
                height: 24px;
                position: absolute;
                left: 50%;
                top: 50%;
                margin-left: -20px;
                margin-top: -12px;">            <i style="background: url(//qzonestyle.gtimg.cn/aoi/img/video-loading.gif); 
                width: 40px;
                height: 24px;"></i>        </div></div><div id="vpjs-videoBigPlayButton-1516968272464" style="display: block;">        <span style="background: url(//qzonestyle.gtimg.cn/qzone/hybrid/common/videoPlayer/img/big-play-button.png) no-repeat center;
        background-size: cover;
        position: absolute;
        top: 50%;
        left: 50%;
        width: 60px;
        height: 60px;
        margin-left: -30px;
        margin-top: -30px;
        cursor: pointer;"></span></div><div id="vpjs-videoError-1516968272464" style="display: none;">        <div style="position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        background: url(//qzonestyle.gtimg.cn/aoi/img/live/people-empty.png) no-repeat center;
        background-size: cover;
        z-index: 99;">
        <p style="position: absolute;
            left: 50%;
            top: 50%;
            text-align: center;
            width: 200px;
            margin-left: -100px;
            margin-top: -9px;">
            <span class="vpjs-error-message" style="vertical-align: middle;">视频播放失败            </span>
        </p>
    </div></div></div></div></a>

from selenium import webdriverimport osimport timeimport pymysqlfrom bs4 import BeautifulSouph, pt, u, p, db = 'localhost', 3306, 'root', 'root', 'qqzone'def mysql_fetch(sql):    global h, pt, u, p, db    try:        conn = pymysql.connect(host=h, port=pt, user=u, passwd=p, db=db, charset='utf8mb4')    except Exception as e:        print(e)        return ()    cursor = conn.cursor()    cursor.execute(sql)    conn.commit()    cursor.close()    conn.close()    return cursor.fetchall()def mysql_write(sql):    global h, pt, u, p, db    try:        conn = pymysql.connect(host=h, port=pt, user=u, passwd=p, db=db, charset='utf8mb4')    except Exception as e:        print(e)        return 1    cursor = conn.cursor()    cursor.execute(sql)    conn.commit()    cursor.close()    conn.close()    return 0# mp4driver = webdriver.Firefox() # 使用get()方法打开待抓取的URL# coco 706386164 cd 3154028129target_qq_d = {'c': '704', 'd': '329'}qq_u, qq_p, target_qq = 'g1om', 'ziy4', target_qq_d['dz']driver.get('http://user.qzone.qq.com/{}/'.format(target_qq))time.sleep(5)# 等待5秒后,判断页面是否需要登录,通过查找页面是否有相应的DIV的id来判断try:    driver.find_element_by_id('login_div')    a = Trueexcept:    a = Falseprint(a)if a == True:    # 如果页面存在登录的DIV,则模拟登录    driver.switch_to.frame('login_frame')    driver.find_element_by_id('switcher_plogin').click()    driver.find_element_by_id('u').clear()  # 选择用户名框    driver.find_element_by_id('u').send_keys(qq_u)    driver.find_element_by_id('p').clear()    driver.find_element_by_id('p').send_keys(qq_p)    driver.find_element_by_id('login_button').click()    time.sleep(3)driver.implicitly_wait(3)# 判断好友空间是否设置了权限,通过判断是否存在元素ID:QM_OwnerInfo_Icon# try:#     driver.find_element_by_id('QM_OwnerInfo_Icon')#     b = True# except:#     b = False# # 如果有权限能够访问到说说页面,那么定位元素和数据,并解析b = Trueif b == True:    time.sleep(2)    myframe = 'app_canvas_frame'    myframe = 'QM_Feeds_Iframe'    driver.refresh()    time.sleep(3)    try:        for isc in range(30):            # 今日头条 非iframe  无限次            # qq空间说说 iframe 固定20条 2次报错            time.sleep(2)            js = 'window.scrollTo(0,document.body.scrollHeight)'            driver.execute_script(js)    except Exception as e:        print('window.scrollTo-->', e)    driver.switch_to.frame(myframe)    time.sleep(3)    # # 尝试一下获取Cookie,使用get_cookies()    # cookie = driver.get_cookies()    # cookie_dict = []    # for c in cookie:    #     ck = "{0}={1};".format(c['name'], c['value'])    #     cookie_dict.append(ck)    # i = ''    # for c in cookie_dict:    #     i += c    # print('Cookies:', i)    # print("==========完成================")    with open('qqzong.vedio.tmp.0html', 'w', encoding='utf-8') as fw:        # ps        fw.write(driver.page_source)    try:        driver.quit()    except Exception as e:        print(e)    sql_str_l, sql = [], 'INSERT INTO qqzoneshuoshuo (words,imgurls,time_site,time_script) VALUES '    with open('qqzong.vedio.tmp.0html', 'r', encoding='utf-8') as fo:        soup = BeautifulSoup(fo, 'html.parser')        try:            l = soup.find_all('li', class_='f-single f-s-s')            for i in l:                i_txt, f_nick, f_info, info_detail = i.text, i.find('div', class_='f-nick').text, i.find('div',                                                                                                         class_='f-info').text, i.find(                    'div', class_='info-detail').text                ii = i.find("a", attrs={"data-v_vidioswfurl": True})                if ii is not None:                    media_l = [ii.attrs['data-v_vidioswfurl']]                elif len(i.find_all('img')) > 1:                    media_l = [h.attrs['src'] for h in i.find_all('img')[1:]]                else:                    media_l = []                # words,imgurls,time_site,time_script                not_support_s = 'Your browser does not support the video tag.'                sql_part = '( "{}","{}","{}","{}" )'.format(                    i_txt.replace('{}{}'.format(f_nick, ' '), '').replace(info_detail, '').replace(not_support_s, ''),                    ','.join(media_l),                    info_detail, int(time.time()))                sql_str_l.append(sql_part)        except Exception as e:            print(e)    sql = '{}{}'.format(sql, ','.join(sql_str_l))    print(sql)    try:        mysql_write(sql)        print(sql)    except Exception as e:        print(e)获取视频地址所在的html中的值保存原理

url='http://vwecam.gtimg.com/1006_9e83353154174dba9cc28a72b2c3ccbb.f0.mp4?ptype=http&vkey=05BFF9D7555A2A0E224402DCC6946D6DC3AB905326DBCA4D3EEA80C3F1904B9414C8C75586A994D87A0359AD51F1B51ED639C20B1E7AD58B&sdtfrom=v1000&owner=3154028129'r=requests.get(url)with open('my.mp4','wb') as fw:  fw.write(r.content)
点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Easter79 Easter79
3年前
swap空间的增减方法
(1)增大swap空间去激活swap交换区:swapoff v /dev/vg00/lvswap扩展交换lv:lvextend L 10G /dev/vg00/lvswap重新生成swap交换区:mkswap /dev/vg00/lvswap激活新生成的交换区:swapon v /dev/vg00/lvswap
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
ES6 新增的数组的方法
给定一个数组letlist\//wu:武力zhi:智力{id:1,name:'张飞',wu:97,zhi:10},{id:2,name:'诸葛亮',wu:55,zhi:99},{id:3,name:'赵云',wu:97,zhi:66},{id:4,na
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
10个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这