Skip to content

Commit 6a6ba75

Browse files
Add files via upload
1 parent 53d8a6e commit 6a6ba75

File tree

3 files changed

+110
-1
lines changed

3 files changed

+110
-1
lines changed

Convert.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import re
2+
3+
# Read index.html file
4+
with open('index.html', 'r') as file:
5+
index_content = file.read()
6+
7+
# Extract video title and data-src from index.html
8+
match = re.search(r'<p>(.*?)</p>', index_content)
9+
video_title = match.group(1)
10+
11+
data_src_match = re.search(r'data-src="(.*?)"', index_content)
12+
data_src = data_src_match.group(1)
13+
14+
# Read test.html file
15+
with open('test.html', 'r') as file:
16+
test_content = file.read()
17+
18+
# Replace video title and data-src in test.html
19+
test_content = re.sub(r'<p id="video-title".*?</p>', f'<p id="video-title" data-src="{data_src}">{video_title}</p>', test_content)
20+
21+
# Write updated content to test.html
22+
with open('test.html', 'w') as file:
23+
file.write(test_content)
24+
25+
print("Conversion completed successfully!")

index.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ <h2>Videos</h2>
5151
</div>
5252
<p>SML Movie: Chef Pee Pee Quits Part 2</p>
5353
</section>
54+
<section>
55+
<div class="video-container">
56+
<iframe src="https://www.youtube.com/embed/6eTH0EtzmlM" frameborder="0" allowfullscreen></iframe>
57+
</div>
58+
<p>SML Movie: Chef Pee Pee Quits Part 5 [REUPLOADED] - YouTube</p>
59+
</section>
60+
5461
<section>
5562
<div class="video-container">
5663
<iframe data-src="https://www.youtube.com/embed/lbqEPZI0-zA" frameborder="0" allowfullscreen></iframe>
@@ -88,7 +95,7 @@ <h2>Videos</h2>
8895

8996
<section>
9097
<div class="video-container">
91-
<iframe src="https://www.youtube.com/embed/_pIX_GZpdo4" frameborder="0" allowfullscreen></iframe>
98+
<iframe src="https://www.youtube.com/embed/pIXGZpdo4" frameborder="0" allowfullscreen></iframe>
9299
</div>
93100
<p>SML Movie: Jeffy Gets Stuck [REUPLOADED] - YouTube</p>
94101
</section>

test.html

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>SML Archive</title>
7+
<link rel="stylesheet" href="styles.css"> <!-- Link to the external CSS file -->
8+
<style>
9+
.video-container {
10+
display: none;
11+
position: relative;
12+
padding-bottom: 56.25%; /* 16:9 aspect ratio (height divided by width) */
13+
height: 0;
14+
overflow: hidden;
15+
}
16+
17+
.video-container iframe {
18+
position: absolute;
19+
top: 0;
20+
left: 0;
21+
width: 100%;
22+
height: 100%;
23+
}
24+
25+
section {
26+
text-align: center;
27+
}
28+
</style>
29+
</head>
30+
<body>
31+
<header>
32+
<img src="SML_new_logo.webp" alt="Channel Icon">
33+
<h1>SML Archive</h1>
34+
</header>
35+
36+
<nav>
37+
<!-- Navigation links -->
38+
<ul>
39+
<li><a href="#">Home</a></li>
40+
<li><a href="#">Videos</a></li>
41+
<li><a href="#">About</a></li>
42+
</ul>
43+
</nav>
44+
45+
<main>
46+
<!-- Content of the channel page -->
47+
<section>
48+
<h2>Videos</h2>
49+
<!-- Embedded video with auto scaling -->
50+
<div class="video-container">
51+
<iframe id="video-iframe" frameborder="0" allowfullscreen></iframe>
52+
</div>
53+
<p id="video-title" data-src="https://www.youtube.com/embed/6w8QkUBx0qc">SML Movie: Chef Pee Pee Quits Part 2</p>
54+
</section>
55+
</main>
56+
57+
<footer>
58+
<p>&copy; 2023 SML Archive. All rights reserved.</p>
59+
</footer>
60+
61+
<script>
62+
window.addEventListener('DOMContentLoaded', function() {
63+
var videoContainer = document.querySelector('.video-container');
64+
var videoIframe = document.getElementById('video-iframe');
65+
var videoTitle = document.getElementById('video-title');
66+
67+
videoTitle.addEventListener('click', function() {
68+
if (!videoContainer.style.display || videoContainer.style.display === 'none') {
69+
var dataSrc = videoTitle.getAttribute('data-src');
70+
videoIframe.setAttribute('src', dataSrc);
71+
videoContainer.style.display = 'block';
72+
}
73+
});
74+
});
75+
</script>
76+
</body>
77+
</html>

0 commit comments

Comments
 (0)