7-06 504 views
一、出现的原因
由于各大互联网视频app均推出了“轻奢主义”的营销模式,导致了很多优质视频需要我们办这个月卡、年卡才能观看,更离谱的是腾讯最近推出了会员花钱超前点播的模式,简直吃香太难看。各路英雄简直看不下去了。各种解析网站纷纷出炉。方便我等屌丝继续白嫖。这边通过python来了解下解析的情况。
二、号称万能的解析器
链接式输入
原理解读:用户输入视频播放链接,通过解析器解析你的vip地址,通过解析网站的vip信息vnc到您的浏览器上,实现播放效果(个人猜测)
电影名输入
原理解读:这个其实和上面差不多,只是通过python处理了下爬取的web信息,将电影名转换为具体的视频播放链接地址,再通过解析器解析出来,但是这种经常会不准确,具体原因还是版权原因,比如某某电影只是在某奇艺独播,而你却在优酷里爬取。那明显是获取不到播放地址的。要做到输入电影名达到万能解析,必须涵盖所以视频播放商才行。 所以还是链接式播放靠谱点。
#!/usr/bin/python3 # -*- coding: utf-8 -*- from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import (QWidget, QLabel,QGridLayout,QLineEdit,QMainWindow,QMessageBox, QComboBox, QApplication) from PyQt5.QtGui import QIcon,QColor from PyQt5.QtCore import Qt import sys import webbrowser class VIPVideo(QWidget): def __init__(self): super().__init__() self.setupUi(self) def setupUi(self, Form): Form.setObjectName("Form") Form.resize(447, 338) Form.setWindowIcon(QIcon('cat.ico')) self.comboBox_2 = QtWidgets.QComboBox(Form) self.comboBox_2.setGeometry(QtCore.QRect(200, 60, 171, 22)) self.comboBox_2.setObjectName("comboBox_2") self.comboBox_2.addItem("Channel 0") self.comboBox_2.addItem("Channel 1") self.comboBox_2.addItem("Channel 2") self.comboBox_2.addItem("Channel 3") self.comboBox_2.addItem("Channel 4") self.comboBox_2.addItem("Channel 5") self.comboBox_2.addItem("Channel 6") self.comboBox_2.addItem("Channel 7") self.comboBox_2.setEditable(False) self.label_1 = QtWidgets.QLabel(Form) self.label_1.setGeometry(QtCore.QRect(70, 60, 121, 21)) self.label_1.setObjectName("label_1") self.label_2 = QtWidgets.QLabel(Form) self.label_2.setGeometry(QtCore.QRect(70, 110, 121, 21)) self.label_2.setObjectName("label_2") self.lineEdit = QtWidgets.QLineEdit(Form) self.lineEdit.setGeometry(QtCore.QRect(200, 110, 171, 20)) self.lineEdit.setObjectName("lineEdit") self.textEdit = QtWidgets.QTextEdit(Form) self.textEdit.setGeometry(QtCore.QRect(70, 210, 301, 111)) self.textEdit.setObjectName("textEdit") self.textEdit.setEnabled(False) self.pushButton = QtWidgets.QPushButton(Form) self.pushButton.setGeometry(QtCore.QRect(100, 160, 75, 23)) self.pushButton.setObjectName("pushButton") self.pushButton.clicked.connect(self.OpenUrl) self.pushButton_2 = QtWidgets.QPushButton(Form) self.pushButton_2.setGeometry(QtCore.QRect(260, 160, 75, 23)) self.pushButton_2.setObjectName("pushButton_2") self.pushButton_2.clicked.connect(self.close) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) Form.setFixedSize(Form.width(),Form.height()) Form.show() def OpenUrl(self,Form): str="" str1=self.lineEdit.text() str2=self.comboBox_2.currentText() if str2=="Channel 0": str="https://okjx.cc/?url=" elif str2=="Channel 1": str="http://jx.du2.cc/?url=" elif str2=="Channel 2": str="http://jx.drgxj.com/?url=" elif str2 == "Channel 3": str="http://jx.618ge.com/?url=" elif str2 == "Channel 4": str="http://vip.jlsprh.com/?url=" elif str2=="Channel 5": str="http://jx.drgxj.com/?url=" elif str2 == "Channel 6": str="http://jx.598110.com/?url=" elif str2 == "Channel 7": str="http://jx.idc126.net/jx/?url=" else: str="https://api.vparse.org/?url=" if str1=="": reply = QMessageBox.question(self, 'Message', "Please correctly input url !", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) else: webbrowser.open(str+str1) def retranslateUi(self, Form): _translate = QtCore.QCoreApplication.translate Form.setWindowTitle(_translate("Form", "vip视频播放")) self.label_1.setText(_translate("Form", "选择一个播放线路:")) self.label_2.setText(_translate("Form", "输入vip视频播放地址:")) self.textEdit.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;color:red;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">警告:此软件仅用于学习技术,不应用于任何商业目的。 </p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">By ycy rewrite ...just do it !</p>\n" "</body></html>")) self.pushButton.setText(_translate("Form", "播放")) self.pushButton_2.setText(_translate("Form", "退出")) if __name__ == '__main__': app = QApplication(sys.argv) ex = VIPVideo() sys.exit(app.exec_())
运行情况:
还可以通过pyinstaller 打包成exe程序
这个是链接是输入方式播放,基本上大部分电影都能看到。
下面再试试某奇艺的解析。通过电影名解析。存在不准确的情况。
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'WatchVIPVideo.ui' # Created by: PyQt5 UI code generator 5.10.1 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import (QWidget, QLabel,QGridLayout,QLineEdit,QMainWindow,QMessageBox, QComboBox, QApplication) from PyQt5.QtGui import QIcon,QColor from PyQt5.QtCore import Qt import sys,re,requests import webbrowser class VIPVideo(QWidget): def __init__(self): super().__init__() self.setupUi(self) def setupUi(self, Form): Form.setObjectName("Form") Form.resize(447, 338) Form.setWindowIcon(QIcon('cat.ico')) self.comboBox_2 = QtWidgets.QComboBox(Form) self.comboBox_2.setGeometry(QtCore.QRect(200, 60, 171, 22)) self.comboBox_2.setObjectName("comboBox_2") self.comboBox_2.addItem("Channel 0") self.comboBox_2.addItem("Channel 1") self.comboBox_2.addItem("Channel 2") self.comboBox_2.addItem("Channel 3") self.comboBox_2.addItem("Channel 4") self.comboBox_2.addItem("Channel 5") self.comboBox_2.addItem("Channel 6") self.comboBox_2.addItem("Channel 7") self.comboBox_2.setEditable(False) self.label_1 = QtWidgets.QLabel(Form) self.label_1.setGeometry(QtCore.QRect(70, 60, 121, 21)) self.label_1.setObjectName("label_1") self.label_2 = QtWidgets.QLabel(Form) self.label_2.setGeometry(QtCore.QRect(70, 110, 121, 21)) self.label_2.setObjectName("label_2") self.lineEdit = QtWidgets.QLineEdit(Form) self.lineEdit.setGeometry(QtCore.QRect(200, 110, 171, 20)) self.lineEdit.setObjectName("lineEdit") self.textEdit = QtWidgets.QTextEdit(Form) self.textEdit.setGeometry(QtCore.QRect(70, 210, 301, 111)) self.textEdit.setObjectName("textEdit") self.textEdit.setEnabled(False) self.pushButton = QtWidgets.QPushButton(Form) self.pushButton.setGeometry(QtCore.QRect(100, 160, 75, 23)) self.pushButton.setObjectName("pushButton") self.pushButton.clicked.connect(self.OpenUrl) self.pushButton_2 = QtWidgets.QPushButton(Form) self.pushButton_2.setGeometry(QtCore.QRect(260, 160, 75, 23)) self.pushButton_2.setObjectName("pushButton_2") self.pushButton_2.clicked.connect(self.close) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) Form.setFixedSize(Form.width(),Form.height()) Form.show() def OpenUrl(self,Form): str="" #获取到了电影名称 movie_name=self.lineEdit.text() headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36'} b = [] for i in range(1, 2): url = "http://so.iqiyi.com/so/q_{}?source=default&sr=450291991267".format(movie_name) # 共20页,根据每页的网址变换规律进行拼接 r = requests.get(url, headers=headers) reg = re.compile(r'<a.+?href=\"(//www.+?)\".*>') msg = re.findall(reg, r.text) str1 = msg[2].split("//")[-1] # str1=self.lineEdit.text() # str1 = "https://www.iqiyi.com/v_19rr7qns08.html#vfrm=19-9-0-1" str2=self.comboBox_2.currentText() if str2=="Channel 0": str="https://okjx.cc/?url=" elif str2=="Channel 1": str="http://jx.du2.cc/?url=" elif str2=="Channel 2": str="http://jx.drgxj.com/?url=" elif str2 == "Channel 3": str="http://jx.618ge.com/?url=" elif str2 == "Channel 4": str="http://vip.jlsprh.com/?url=" elif str2=="Channel 5": str="http://jx.drgxj.com/?url=" elif str2 == "Channel 6": str="http://jx.598110.com/?url=" elif str2 == "Channel 7": str="http://jx.idc126.net/jx/?url=" else: str="https://api.vparse.org/?url=" if str1=="": reply = QMessageBox.question(self, 'Message', "Please correctly input url !", QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) else: webbrowser.open(str+str1) def retranslateUi(self, Form): _translate = QtCore.QCoreApplication.translate Form.setWindowTitle(_translate("Form", "某奇艺视频播放解析器")) self.label_1.setText(_translate("Form", "选择一个播放线路:")) # self.label_2.setText(_translate("Form", "输入vip视频播放地址:")) self.label_2.setText(_translate("Form", "输入电影名称:")) self.textEdit.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;color:red;\">\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">警告:此软件仅用于学习技术,不应用于任何商业目的。 </p>\n" "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">By ycy rewrite ...just do it !</p>\n" "</body></html>")) self.pushButton.setText(_translate("Form", "播放")) self.pushButton_2.setText(_translate("Form", "退出")) if __name__ == '__main__': app = QApplication(sys.argv) ex = VIPVideo() sys.exit(app.exec_())
运行情况:
测试了下基本成功播放率在50%。不是很理想哦~
好了,解析介绍到这里了,感谢您的阅读,下期再见~
版权属于: 抓不住的疯
原文地址: https://www.ycy114.com/index.php/2020/07/06/vip%e7%94%b5%e5%bd%b1%e7%9a%84%e8%a7%a3%e6%9e%90/
转载时必须以链接形式注明原始出处及本声明。
😆