forked from sydia1103/Late-2012-YT-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
252 lines (202 loc) · 11.5 KB
/
index.php
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?php
include("./static/header.php");
include("./static/guide.php");
// everything here is just calling for most popular videos on youtube and echoing it with the original html.
// i recommend you don't bother much with this.
$count = 0;
?>
<div id="content">
<div class="branded-page-v2-container enable-fancy-subscribe-button branded-page-v2-secondary-column-hidden">
<div class="branded-page-v2-col-container clearfix">
<div class="branded-page-v2-primary-col">
<div class="branded-page-v2-primary-col-header-container">
<div id="context-source-container" data-context-source="Popular on YouTube" style="display:none;"></div>
</div>
<div class="branded-page-v2-body" id="gh-activityfeed">
<div id="ad_creative_expand_btn_1" class="masthead-ad-control open hid">
<a onclick="masthead.expand_ad(); return false;">
<span>Show ad</span>
<img src="//web.archive.org/web/20121230023058im_/http://s.ytimg.com/yts/img/pixel-vfl3z5WfW.gif" alt="">
</a>
</div>
<div class="context-data-container">
<div class="lohp-newspaper-shelf">
<div class="lohp-large-shelf-container">
<?php
$videoList = json_decode(file_get_contents('https://invidious.zee.li/api/v1/trending?type=movies®ion=US'));
foreach($videoList as $videoList){
//Embed video
if(isset($videoList->videoId)){
if($count < 1) {
echo "<div class='context-data-item'>
<a href='watch?v=".$videoList->videoId."' class='ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CAMQ0h4oAA%3D%3D'><span class='video-thumb ux-thumb yt-thumb-default-370 '><span class='yt-thumb-clip'><span class='yt-thumb-clip-inner'><img alt='Thumbnail' src='https://i.ytimg.com/vi/".$videoList->videoId."/hq720.jpg' onerror=\"this.src='./img/default.png'\" width='370'><span class='vertical-align'></span></span></span></span></a>
<a class='lohp-video-link max-line-2 yt-uix-sessionlink' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CAMQ0h4oAA%3D%3D' href='watch?v=".$videoList->videoId."' title='".$videoList->title."'>".$videoList->title."</a>
<div class='lohp-video-metadata'>
<span class='content-uploader'>
<span class='username-prepend'>by</span> <a href='profile?id=".$videoList->authorId."' class='yt-uix-sessionlink yt-user-name ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D' dir='ltr'>".$videoList->author."</a>
</span>
<span class='view-count'>
".number_format($videoList->viewCount)." views
</span>
<span class='content-item-time-created'>
".$videoList->publishedText."
</span>
</div>
</div>
";
$count++;
}
}
}
$count = 0; //reset count, invidious does not seem to have limit filter
?>
</div>
<div class="lohp-medium-shelves-container">
<?php
$videoList = json_decode(file_get_contents('https://invidious.zee.li/api/v1/trending?type=news®ion=US'));
foreach($videoList as $videoList){
//Embed video
if(isset($videoList->videoId)){
if($count < 3) {
echo "<div class='lohp-medium-shelf context-data-item'>
<div class='lohp-media-object'>
<a href='watch?v=".$videoList->videoId."' class='ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CAYQ0h4oAw%3D%3D'><span class='video-thumb ux-thumb yt-thumb-default-128 '><span class='yt-thumb-clip'><span class='yt-thumb-clip-inner'><img alt='Thumbnail' src='https://i.ytimg.com/vi/".$videoList->videoId."/default.jpg' onerror=\"this.src='./img/default.png'\" width='128'><span class='vertical-align'></span></span></span></span>
</a>
</div>
<div class='lohp-media-object-content lohp-medium-shelf-content'>
<a class='lohp-video-link max-line-2 yt-uix-sessionlink' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CAYQ0h4oAw%3D%3D' href='watch?v=".$videoList->videoId."' title='".$videoList->title."'>".$videoList->title."</a>
<div class='lohp-video-metadata attached'>
<span class='content-uploader'>
<span class='username-prepend'>by</span> <a href='profile?id=".$videoList->authorId."' class='yt-uix-sessionlink yt-user-name ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D' dir='ltr'>".$videoList->author."</a>
</span>
</div>
<div class='lohp-video-metadata'>
<span class='view-count'>
".number_format($videoList->viewCount)." views
</span>
<span class='content-item-time-created' title='2 days ago'>
".$videoList->publishedText."
</span>
</div>
</div>
</div>";
$count++;
}
}
}
$count = 0; //reset count, invidious does not seem to have limit filter
?>
</div>
</div>
<div class="lohp-vbox-list lohp-left-vbox-list">
<div>
<?php
$videoList = json_decode(file_get_contents('https://invidious.fdn.fr/api/v1/popular'));
foreach($videoList as $videoList){
//Embed video
if(isset($videoList->videoId)){
if($count < 15) {
echo "<div class='lohp-shelf-cell-container lohp-category-shelf '>
<div class='lohp-category-shelf-item-list lohp-shelf-size-1'>
<h2 class='branded-page-module-title'>
<a class='spf-link' href='profile?id=".$videoList->authorId."' title='profile?id=".$videoList->authorId."' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&ved=CBIQzh4%3D'>
".$videoList->author."
</a>
</h2>
<div class='lohp-category-shelf-item context-data-item first-shelf-item last-shelf-item'>
<a href='watch?v=".$videoList->videoId."' class='ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CBMQzx4oAA%3D%3D'><span class='video-thumb ux-thumb yt-thumb-default-165 '><span class='yt-thumb-clip'><span class='yt-thumb-clip-inner'><img data-thumb='https://i.ytimg.com/vi/".$videoList->videoId."/default.jpg' onerror=\"this.src='./img/default.png'\" alt='Thumbnail' src='https://i.ytimg.com/vi/".$videoList->videoId."/default.jpg' onerror=\"this.src='./img/default.png'\" width='165' data-group-key='thumb-group-0'><span class='vertical-align'></span></span></span></span></a>
<a class='lohp-video-link max-line-2 yt-uix-sessionlink' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CBMQzx4oAA%3D%3D' href='watch?v=".$videoList->videoId."' title='".$videoList->title."'>".$videoList->title."</a>
<div class='lohp-video-metadata'>
<span class='view-count'>
".number_format($videoList->viewCount)." views
</span>
<span class='content-item-time-created'>
".$videoList->publishedText."
</span>
</div>
</div>
</div>
</div>";
$count++;
}
}
}
$count = 0; //reset count, invidious does not seem to have limit filter
?>
</div>
</div>
<div class="lohp-vbox-list lohp-right-vbox-list">
<div class="lohp-vertical-shelf">
<h2 class="branded-page-module-title">
<a class="spf-link" href="/web/20121230023058/http://www.youtube.com/channel/HCp-Rdqh3z4Uc?feature=g-logo" title="Music" data-sessionlink="ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&ved=CEoQzh4%3D">
Music
</a>
</h2>
<?php
$videoList = json_decode(file_get_contents('https://invidious.zee.li/api/v1/trending?type=music®ion=US'));
foreach($videoList as $videoList){
//Embed video
if(isset($videoList->videoId)){
if($count < 3) {
echo "<div class='lohp-vertical-shelf-item context-data-item'>
<div class='lohp-media-object'>
<a href='watch?v=".$videoList->videoId."' class='ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CFEQzx4oAA%3D%3D'><span class='video-thumb ux-thumb yt-thumb-default-64 '><span class='yt-thumb-clip'><span class='yt-thumb-clip-inner'><img alt='Thumbnail' src='https://i.ytimg.com/vi/".$videoList->videoId."/default.jpg' onerror=\"this.src='./img/default.png'\" width='64' data-group-key='thumb-group-1'><span class='vertical-align'></span></span></span></span></a>
</div>
<div class='lohp-vertical-shelf-item-content lohp-media-object-content'>
<a class='lohp-video-link max-line-3 yt-uix-sessionlink' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CFEQzx4oAA%3D%3D' href='watch?v=".$videoList->videoId."' title='".$videoList->title."'>".$videoList->title."</a>
<div class='lohp-video-metadata attached'>
<span class='content-uploader'>
<span class='username-prepend'>by</span> <a href='profile?id=".$videoList->authorId."' class='yt-uix-sessionlink yt-user-name ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D' dir='ltr'>".$videoList->author."</a>
</span>
</div>
</div>
</div>";
$count++;
}
}
}
$count = 0; //reset count, invidious does not seem to have limit filter
?>
</div>
<div class="lohp-vertical-shelf">
<h2 class="branded-page-module-title">
<a class="spf-link" href="/web/20121230023058/http://www.youtube.com/channel/HC4qRk91tndwg?feature=g-logo" title="Most Popular" data-sessionlink="ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&ved=CFAQzh4%3D">
Gaming
</a>
</h2>
<?php
$videoList = json_decode(file_get_contents('https://invidious.zee.li/api/v1/trending?type=gaming®ion=US'));
foreach($videoList as $videoList){
//Embed video
if(isset($videoList->videoId)){
if($count < 3) {
echo "<div class='lohp-vertical-shelf-item context-data-item'>
<div class='lohp-media-object'>
<a href='watch?v=".$videoList->videoId."' class='ux-thumb-wrap yt-uix-sessionlink yt-uix-contextlink contains-addto ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CFEQzx4oAA%3D%3D'><span class='video-thumb ux-thumb yt-thumb-default-64 '><span class='yt-thumb-clip'><span class='yt-thumb-clip-inner'><img alt='Thumbnail' src='https://i.ytimg.com/vi/".$videoList->videoId."/default.jpg' onerror=\"this.src='./img/default.png'\" width='64' data-group-key='thumb-group-1'><span class='vertical-align'></span></span></span></span></a>
</div>
<div class='lohp-vertical-shelf-item-content lohp-media-object-content'>
<a class='lohp-video-link max-line-3 yt-uix-sessionlink' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D&feature=g-logo&ved=CFEQzx4oAA%3D%3D' href='watch?v=".$videoList->videoId."' title='".$videoList->title."'>".$videoList->title."</a>
<div class='lohp-video-metadata attached'>
<span class='content-uploader'>
<span class='username-prepend'>by</span> <a href='profile?id=".$videoList->authorId."' class='yt-uix-sessionlink yt-user-name ' data-sessionlink='ei=CPyeyIWLwbQCFZkQIQodPx8kow%3D%3D' dir='ltr'>".$videoList->author."</a>
</span>
</div>
</div>
</div>";
$count++;
}
}
}
$count = 0; //reset count, invidious does not seem to have limit filter
?>
</div>
</div>
</div>
<div style="clear:both;"></div>
</div>
</div>
</div>
</div>
<hr class="branded-page-v2-col-container-bottom-border">
</div>
</div>