forked from LBojanic/python-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
youtube.py
32 lines (21 loc) · 806 Bytes
/
youtube.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
import json
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWebKit import *
from PyQt5.QtWebKitWidgets import *
class Youtube(QMainWindow):
def __init__(self, page, parent=None):
super(Youtube, self).__init__(parent)
self.setFixedSize(1200, 800)
web = QWebView()
web.load(QUrl('http://' + page.lower()))
view = QGraphicsView(self)
view.setFixedSize(1200, 800)
view.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
view.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
_layout = QVBoxLayout(view)
scene = QGraphicsScene(self)
_layout.addWidget(web)
view.setScene(scene)