首先附上2个播放地址,可以解析视频网站,我只是个视频搬运工,暂时未添加下载功能。

www.wq114.org/weixin.php?url=

http://www.wmxz.wang/video.php?url=

两个网站都可快速解析出视频播放地址

上图

tkinter模块代码如下

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

from tkinter.ttk import Button,Entry,Radiobutton,Scrollbar
from tkinter import END,Label,Tk,StringVar,Listbox,messagebox,SINGLE,PhotoImage
from 爱奇艺_project.movie_get import Pro
from PIL import Image,ImageTk
import io
import re
import requests
# from urllib.request import urlopenclass Movie_app:def __init__(self):self.win=Tk()self.win.geometry('600x420')self.win.title("爱奇艺-优酷-PPTV视频播放下载器V3.1")self.creat_res()self.creat_radiores()self.config()self.page=1self.p=Pro()self.win.mainloop()def creat_res(self):self.temp=StringVar()#url地址self.temp2=StringVar()self.t1=StringVar()#通道self.t3=StringVar()#爱奇艺,优酷,PPTVself.La_title=Label(self.win,text="地址:")self.La_way=Label(self.win,text="选择视频通道:")self.R_way1=Radiobutton(self.win,text="通道A",variable=self.t1,value=True)self.R_way2=Radiobutton(self.win,text="通道B",variable=self.t1,value=False)self.R_aiqiyi=Radiobutton(self.win,text="爱奇艺",variable=self.t3,value="a")self.R_youku=Radiobutton(self.win,text="优酷",variable=self.t3,value="y")self.R_pptv=Radiobutton(self.win,text="PPTV",variable=self.t3,value="p")self.B_play=Button(self.win,text="播放▶")self.B_uppage=Button(self.win,text="上页")self.B_nextpage=Button(self.win,text="下页")self.B_search=Button(self.win,text="♣搜索全站♠")self.La_mesasge=Label(self.win,text="☜  ⇠☸⇢  ☞",bg="pink")self.La_page=Label(self.win,bg="#BFEFFF")self.S_croll=Scrollbar(self.win)self.L_box=Listbox(self.win,bg="#BFEFFF",selectmode=SINGLE)self.E_address=Entry(self.win,textvariable=self.temp)self.La_title.place(x=10,y=50,width=50,height=30)self.E_address.place(x=70,y=50,width=200,height=30)self.B_play.place(x=300,y=50,width=50,height=30)self.R_way1.place(x=160,y=10,width=70,height=30)self.R_way2.place(x=240,y=10,width=70,height=30)self.La_way.place(x=10,y=10,width=100,height=30)self.R_aiqiyi.place(x=20,y=100,width=70,height=30)self.R_youku.place(x=90,y=100,width=70,height=30)self.R_pptv.place(x=160,y=100,width=70,height=30)self.B_search.place(x=252,y=140,width=100,height=30)self.La_mesasge.place(x=80,y=125,width=90,height=20)self.L_box.place(x=10,y=180,width=252,height=230)self.S_croll.place(x=260,y=180,width=20,height=230)self.B_uppage.place(x=10,y=140,width=50,height=30)self.B_nextpage.place(x=180,y=140,width=50,height=30)self.La_page.place(x=80,y=150,width=90,height=28)def creat_radiores(self):self.movie=StringVar()#电影self.S_croll2=Scrollbar()#分集self.La_pic=Label(self.win,bg="#E6E6FA")self.La_movie_message=Listbox(self.win,bg="#7EC0EE")self.R_movie=Radiobutton(self.win,text="电影",variable=self.movie,value="m")self.tv=Radiobutton(self.win,text="电视剧",variable=self.movie,value="t")self.zhongyi=Radiobutton(self.win,text="综艺",variable=self.movie,value="z")self.dongman=Radiobutton(self.win,text="动漫",variable=self.movie,value="d")self.jilupian=Radiobutton(self.win,text="纪录片",variable=self.movie,value="j")self.B_view=Button(self.win,text="✤查看✤")self.B_info=Button(self.win,text="使用说明")self.B_clearbox=Button(self.win,text="清空列表")self.B_add=Button(self.win,text="添加到播放列表")self.R_movie.place(x=290,y=180,width=80,height=30)self.B_view.place(x=290,y=330,width=70,height=30)self.B_add.place(x=370,y=255,width=100,height=30)self.B_clearbox.place(x=500,y=255,width=70,height=30)self.tv.place(x=290,y=210,width=80,height=30)self.zhongyi.place(x=290,y=240,width=80,height=30)self.dongman.place(x=290,y=270,width=80,height=30)self.jilupian.place(x=290,y=300,width=80,height=30)self.La_movie_message.place(x=370,y=290,width=200,height=120)self.La_pic.place(x=370,y=10,width=200,height=240)self.B_info.place(x=290,y=370,width=70,height=30)self.S_croll2.place(x=568,y=290,width=20,height=120)def show_info(self):msg="""1.输入视频播放地址,即可播放选择A或者B可切换视频源2.选择视频网,选择电视剧或者电影,搜索全网后选择想要看得影片,点查看,在右方list里选择分集视频添加到播放列表里点选播放"""messagebox.showinfo(title="使用说明",message=msg)def config(self):self.t1.set(True)self.B_play.config(command=self.play_url_movie)self.B_search.config(command=self.search_full_movie)self.B_info.config(command=self.show_info)self.S_croll.config(command=self.L_box.yview)self.L_box['yscrollcommand']=self.S_croll.setself.S_croll2.config(command=self.La_movie_message.yview)self.La_movie_message['yscrollcommand']=self.S_croll2.setself.B_view.config(command=self.view_movies)self.B_add.config(command=self.add_play_list)self.B_clearbox.config(command=self.clear_lisbox2)self.B_uppage.config(command=self.uppage_)self.B_nextpage.config(command=self.nextpage_)def uppage_(self):print('---------上一页---------')self.page-=1print(self.page)if self.page<1:self.page=1def nextpage_(self):print('----------下一页--------')self.page+=1print(self.page)if self.t3=="a" or self.t3=="y":if self.page>30:self.page=30elif self.t3=="p":if self.movie=="m":if self.page>165:self.page=165elif self.movie == "t":if self.page > 85:self.page = 85elif self.movie == "z":if self.page > 38:self.page = 38elif self.movie == "d":if self.page > 146:self.page = 146elif self.movie == "j":if self.page > 40:self.page = 40def clear_lisbox(self):self.L_box.delete(0,END)def clear_lisbox2(self):self.La_movie_message.delete(0,END)def search_full_movie(self):print("-----search----")self.La_page.config(text="当前页:{}".format(self.page))self.clear_lisbox()try:movie_url, movie_title, movie_src_pic=self.p.get_movie_res(self.t3.get(),self.movie.get(),self.page)self.movie_dic={}for i,j,k in zip(movie_title,movie_url,movie_src_pic):self.movie_dic[i]=[j,k]for title in movie_title:self.L_box.insert(END,title)print(self.movie_dic)return self.movie_dicexcept:messagebox.showerror(title='警告',message='请选择电影或者电视剧')def add_play_list(self):print('---------playlist----------')print(self.movie_dic)if self.La_movie_message.get(self.La_movie_message.curselection())=="":messagebox.showwarning(title="警告",message='请在列表选择影片')else:print("电影名字:",self.La_movie_message.get(self.La_movie_message.curselection()))if self.movie.get()!="m":self.temp.set(self.new_more_dic[self.La_movie_message.get(self.La_movie_message.curselection())])else:self.temp.set(self.movie_dic[self.La_movie_message.get(self.La_movie_message.curselection())][0])def view_pic(self,pic_url):print('--------viewpic---------')pa_url_check=r'//.+[.]jpg'if re.match(pa_url_check,pic_url):print("ok")pic_url="http:"+pic_urlprint(pic_url)data=requests.get(pic_url).content# data=urlopen(pic_url).read()io_data=io.BytesIO(data)self.img=Image.open(io_data)self.u=ImageTk.PhotoImage(self.img)self.La_pic.config(image=self.u)def view_movies(self):print("--------viewmovie----------")cur_index=self.L_box.curselection()print(self.L_box.get(cur_index))if self.movie.get()!="m":#非电影类self.new_more_dic=self.p.get_more_tv_urls(self.movie_dic[self.L_box.get(cur_index)][0],self.t3.get(),self.movie.get())print(self.new_more_dic)for i,fenji_url in self.new_more_dic.items():self.La_movie_message.insert(END, i)else:#电影类self.La_movie_message.insert(END,self.L_box.get(cur_index))self.view_pic(self.movie_dic[self.L_box.get(self.L_box.curselection())][1])#加载图片def play_url_movie(self):print("--------ok-----------")# print(type(self.t1.get()),self.t1.get())if self.temp.get()=="":messagebox.showwarning(title="警告",message="请先输入视频地址")else:if self.t1.get()!="":self.p.play_movie(self.temp.get(),self.t1.get())else:messagebox.showwarning(title='警告',message='请选择通道')m=Movie_app()视频获取代码如下

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

"""
VIP视频解析:http://www.vipjiexi.com/
无名小站:http://www.wmxz.wang/
http://www.iqiyi.com/lib/dianying/%E5%96%9C%E5%89%A7,%E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%86,2018_11_1.html
"""import requests
import re
import os
from lxml import etree
from  selenium import webdriverclass Pro:header_ai={'Referer': 'http://www.iqiyi.com/','User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.17 Safari/537.36'}header_you={'Referer': 'http://list.youku.com/category/video','User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'}header_pp = {'Referer': 'http://list.pptv.com/','User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'}way=Falsedef __init__(self):passdef search_movies_type(self,u_name,u_type,page):#两个参数 根据状态输出规则dic1 = {'m': 1, 't': 2, 'z': 6, 'd': 4, 'j': 3}dic2 = {'m': 96, 't': 97, 'z': 85, 'd': 100, 'j': 84}dic3 = {'m': 1, 't': 2, 'z': 4, 'd': 3, 'j': 210548}headers={}#爱奇艺 a/电影m:1 t:2 z:6 d:4 j:3  优酷y / m:96 t:97 z:85 d:100 j:84 pptv  p/m:1 t:2 z:4 d:3 j:210548url, pa_movie_title, pa_movie_url, pa_move_pic='','','',''url_aiqiyi='http://list.iqiyi.com/www/{}/-------------24-{}-1-iqiyi--.html'.format(dic1[u_type],page)url_youku='https://list.youku.com/category/show/c_{}_s_1_d_1_p_{}.html'.format(dic2[u_type],page)# url_pptv='http://list.pptv.com/category/type_{}.html'.format(dic3[u_type])url_pptv='http://list.pptv.com/channel_list.html?page={}&type={}'.format(page,dic3[u_type])pa_ai_movie_title = '//div[@class="site-piclist_pic"]/a[@class="site-piclist_pic_link"]/@title'pa_ai_movie_url = '//div[@class="site-piclist_pic"]/a[@class="site-piclist_pic_link"]/@href'pa_ai_movie_pic = '//div[@class="site-piclist_pic"]/a[@class="site-piclist_pic_link"]/img/@src'pa_you_movie_title='//div[@class="p-thumb"]/a/@title'pa_you_movie_url='//div[@class="p-thumb"]/a/@href'pa_you_movie_pic='//div[@class="p-thumb"]/img[@class="quic"]/@src'pa_pp_movie_title='//li/a[@class="ui-list-ct"]/@title'pa_pp_movie_url='//li/a[@class="ui-list-ct"]/@href'pa_pp_movie_pic='//li/a[@class="ui-list-ct"]/p[@class="ui-pic"]/img/@data-src2'if u_name=="a":#如果是爱奇艺url=url_aiqiyipa_movie_title=pa_ai_movie_titlepa_movie_url=pa_ai_movie_urlpa_move_pic=pa_ai_movie_picheaders=self.header_aielif u_name=="y":#如果是优酷url=url_youkupa_movie_title=pa_you_movie_titlepa_movie_url=pa_you_movie_urlpa_move_pic=pa_you_movie_picheaders=self.header_youelif u_name=="p":#如果是PPTVurl=url_pptvpa_movie_title=pa_pp_movie_titlepa_movie_url=pa_pp_movie_urlpa_move_pic=pa_pp_movie_picheaders=self.header_ppreturn url,pa_movie_title,pa_movie_url,pa_move_pic,headersdef get_movie_res(self,u_name,u_type,page):#输出电影名 链接 图片url, pa_movie_title, pa_movie_url, pa_move_pic,headers=self.search_movies_type(u_name,u_type,page)res=requests.get(url=url,headers=headers).content.decode('utf-8')# print(res)html=etree.HTML(res)movie_url=html.xpath(pa_movie_url)movie_title=html.xpath(pa_movie_title)movie_src_pic=html.xpath(pa_move_pic)print(len(movie_title),movie_title)print(len(movie_url),movie_url)print(len(movie_src_pic),movie_src_pic)return movie_url,movie_title,movie_src_picdef change_urlink(self,lis):for i in range(len(lis)):if '\\' in lis[i]:lis[i] = lis[i].replace('\\', '')# print(lis)return lisdef change_youku_link(self,urls):pa_link='//.+[.]html'if re.match(pa_link,urls):urls='http:'+urlsreturn urlsdef get_more_tv_urls(self,url,u_name,u_type):#获取电视剧分集链接tv_dic_new = {}if u_name == 'y':url=self.change_youku_link(url)res = requests.get(url, headers=self.header_you).text.encode(encoding='utf-8').decode('utf-8')html = etree.HTML(res)print(res)if u_type=="m" or u_type=="t":self.tv_more_title = html.xpath('//div[@class="item item-num"]/@title')self.tv_more_url = html.xpath('//div[@class="item item-num"]/a[@class="sn"]/@href')elif u_type=="d":self.tv_more_title = html.xpath('//div[@class="item item-txt"]/@title')self.tv_more_url = html.xpath('//div[@class="item item-txt"]/a[@class="sn"]/@href')elif u_type=="z":self.tv_more_title = html.xpath('//div[@class="item item-cover"]/@title')self.tv_more_url = html.xpath('//div[@class="item item-cover"]/a/@href')elif u_type == "j":self.tv_more_title = html.xpath('//div[@class="item item-cover current"]/@title')self.tv_more_url = html.xpath('//div[@class="item item-cover current"]/a/@href')elif u_name == 'a':res = requests.get(url, headers=self.header_ai).text.encode(encoding='utf-8').decode('utf-8')html = etree.HTML(res)print(res)if u_type=="m" or u_type=="t" or u_type=='d':self.tv_more_title = html.xpath('//ul/li[@data-albumlist-elem="playItem"]/div[@class="site-piclist_pic"]/a[1]/@title')self.tv_more_url = html.xpath('//ul/li[@data-albumlist-elem="playItem"]/div[@class="site-piclist_pic"]/a[1]/@href')elif u_type=="z" or u_type=="j":self.tv_more_title = html.xpath('//div[@class="recoAlbumTit"]/a[1]/@title')self.tv_more_url = html.xpath('//div[@class="recoAlbumTit"]/a[1]/@href')elif u_name == 'p':res = requests.get(url, headers=self.header_pp).text.encode(encoding='utf-8').decode('utf-8')# html = etree.HTML(res)self.tv_more_url2 = re.compile('{"url":"(.+?)"').findall(res)self.tv_more_url = self.change_urlink(self.tv_more_url2)self.tv_more_title = ["第{}集".format(x) for x in range(1, len(self.tv_more_url) + 1)]for i, j in zip(self.tv_more_title, self.tv_more_url):tv_dic_new[i] = jprint(len(self.tv_more_title), self.tv_more_title)print(len(self.tv_more_url), self.tv_more_url)print(tv_dic_new)return tv_dic_newdef url_change(self,url,flag):pa_url='http://www.iqiyi.com/a_[.+].html'if flag=="0":#通道1if re.match(pa_url, url):_url = url.replace('a', 'v')else:_url=url# new_url='http://www.wq114.org/weixin.php?url={}'.format(_url[21:])new_url='http://www.wq114.org/weixin.php?url={}'.format(_url)return new_urlelif flag == "1":if re.match(pa_url, url):_url = url.replace('a', 'v')else:_url = urlnew_url='http://www.wmxz.wang/video.php?url={}'.format(_url)return new_urldef play_movie(self,url,flag):play_url=self.url_change(url,flag)print('播放地址:',play_url)web = webdriver.Chrome()web.get(play_url)if __name__ == '__main__':p=Pro()

基于tkinter+python36制作得视频播放器,非会员也可播放相关推荐

  1. 最简单的基于DirectShow的示例:视频播放器自定义版

    ===================================================== 最简单的基于DirectShow的示例文章列表: 最简单的基于DirectShow的示例:视 ...

  2. 最简单的基于DirectShow的示例:视频播放器图形界面版

    ===================================================== 最简单的基于DirectShow的示例文章列表: 最简单的基于DirectShow的示例:视 ...

  3. 最简单的基于DirectShow的示例:视频播放器

    ===================================================== 最简单的基于DirectShow的示例文章列表: 最简单的基于DirectShow的示例:视 ...

  4. 音视频播放器与 H.265 播放探索

    一.简介 简单来说,H.265 标准围绕着视频编码标准 H.264,保留原来的某些技术,同时对一些相关的技术加以改进. 改进点包括:提高压缩效率.提高鲁棒性和错误恢复能力.减少实时的时延.减少信道获取 ...

  5. 酷播云html5倍速功能视频播放器,可以倍速播放视频的浏览器插件

    可以倍速播放视频的浏览器插件 Video Speed Controller 是一款倍速播放视频的浏览器插件! 现在网站上播放的视频,基本上都可以实现倍速播放,但偶尔也有些网站上的视频:没有倍速播放功能 ...

  6. python在tk界面播放本地视频_如何使用python3在tkinter窗口中插入视频播放器?

    我想用python构建一个视频播放器,但是我的应用程序将有更多的按钮,而不仅仅是play/pause,所以我需要在窗口中插入视频.在 到现在为止我有这个代码:import tkinter import ...

  7. Python+QT+Selenium制作在线视频播放器

    最近突然想做一个视频播放器,可以在线看视频,关键还没用广告,不用会员,下面给大家介绍一下怎么制作 工具: Python Qt phantomjs 先给大家展示一下效果 下面上代码 导入库: from ...

  8. 【Unity3D自学记录】制作VR视频播放器

    最近VR火的不要不要的,但是综合起来,VR资源最多的还是全景图片和全景视频,今天在这里给大家简单介绍一下如何用Unity制作简单的VR视频播放器. 首先找到EasyMovieTexture这个插件,A ...

  9. 基于Phonon+QT的音视频播放器设计与实现

    目 录 摘 要 2 第一章 软件需求说明书 1 1.1 引言 1 1.2 业务流程整体说明 1 第二章 需求分析报告 3 2.1 引言 3 2.2 任务概述 3 2.3 功能需求 3 2.4 性能需求 ...

最新文章

  1. 2018-3-27 遗传算法中的轮盘赌
  2. python 管道游戏_Python实现超级玛丽游戏系列教程05添加地面,管道和阶梯冲突检测...
  3. 盖茨、奥巴马、马斯克账号被黑,推特遭大规模黑客攻击
  4. 一次完整的渗透测试仅供学习研究
  5. 插入排序、选择排序、快速排序以及归并排序(附Python代码)
  6. 经典C语言程序100例之八
  7. top命令---Linux学习笔记
  8. uclinux多线程应用-网络通信[转]
  9. 微博关注者数量在计算中的作用
  10. (二)使用预定义模型 QStringListModel例子
  11. 程序语言python如何抓取信息_python中系统信息获取psutil使用详解
  12. 英特尓祭出开挖数据价值的“六脉神剑”!
  13. 20个问题:平凡的天才人格特质
  14. java中字符串逆序_[Java教程]一行代码实现字符串逆序输出
  15. mpa和pis_扭矩换算mpa(压力与扭矩换算)
  16. 按键精灵随机输入数字脚本,防重复脚本
  17. select 设置不可用,提交表单时能传值
  18. pdf分解成多个pdf?PDF分割怎么做
  19. 基于java学生信息管理系统
  20. kali linux安装upupoo_Kali Linux 下载、引导、安装

热门文章

  1. Day1:C语言循环控制结构例题之求sinx近似值
  2. android手机连接无线路由器上网设置,手机如何设置无线路由器 手把手教你使用手机设置路由器...
  3. ubuntu16.04下安装GVIM,亲测可用
  4. 计算机视觉库/人脸识别开源软件
  5. python3GUI--轮播图效果展示By:PyQt5(附源码下载地址)
  6. 文件搜索工具—everything,相关原理
  7. 神武3服务器神武币交易中心,《神武3》装备获取指南系统与打造攻略
  8. 展晓凯:“零经验”的我与唱吧从零到四亿
  9. KV数据库是怎样支持SQL语句的
  10. 前端攻城狮面试题总结