Spaces:
Runtime error
Runtime error
shawarmabytes
commited on
Commit
·
e9b62dd
1
Parent(s):
bc8eec6
Update app.py
Browse files
app.py
CHANGED
@@ -74,45 +74,9 @@ def tester(text):
|
|
74 |
elif (results[0]['label']=="love"):
|
75 |
#st_player("https://www.youtube.com/watch?v=XVhEm62Uqog")
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
<div id="player"></div>
|
81 |
-
<script>
|
82 |
-
// 2. This code loads the IFrame Player API code asynchronously.
|
83 |
-
var tag = document.createElement('script');
|
84 |
-
|
85 |
-
tag.src = "https://www.youtube.com/iframe_api";
|
86 |
-
var firstScriptTag = document.getElementsByTagName('script')[0];
|
87 |
-
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
88 |
-
|
89 |
-
// 3. This function creates an <iframe> (and YouTube player)
|
90 |
-
// after the API code downloads.
|
91 |
-
function onYouTubeIframeAPIReady() {
|
92 |
-
var numPl = Math.floor((Math.random() * 50) + 1);
|
93 |
-
var player = new YT.Player("player", {
|
94 |
-
height: '315',
|
95 |
-
width: '560',
|
96 |
-
playerVars: {
|
97 |
-
listType:'playlist',
|
98 |
-
list:'PL3-sRm8xAzY-w9GS19pLXMyFRTuJcuUjy',
|
99 |
-
index: numPl,
|
100 |
-
autoplay: 1,
|
101 |
-
},
|
102 |
-
events: {
|
103 |
-
'onReady': function (event) {
|
104 |
-
//event.target.cuePlaylist({list: "PLFgquLnL59anYA8FwzqNFMp3KMcbKwMaT"});
|
105 |
-
//event.target.playVideo();
|
106 |
-
setTimeout(function() {
|
107 |
-
event.target.setShuffle({'shufflePlaylist' : true});
|
108 |
-
}, 1000);
|
109 |
-
}
|
110 |
-
}
|
111 |
-
});
|
112 |
-
}
|
113 |
-
</script>
|
114 |
-
</body>
|
115 |
-
</html>""",width=560,height=325)
|
116 |
|
117 |
return results[0]['label']
|
118 |
#return results
|
|
|
74 |
elif (results[0]['label']=="love"):
|
75 |
#st_player("https://www.youtube.com/watch?v=XVhEm62Uqog")
|
76 |
|
77 |
+
with open('sadplaylist.txt') as f:
|
78 |
+
contents = f.read()
|
79 |
+
components.html(contents)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
return results[0]['label']
|
82 |
#return results
|