-
- <%
- let itag = null; // Default to null
+ <%
+ let itag = null;
VideoData.adaptiveFormats.forEach(format => {
if (format.itag == '136' || format.itag == '298') {
- itag = '140'; // Set itag to '140' if either '136' or '298' is found
+ itag = '140';
}
});
%>
-<% if (itag && qua !== "medium") { %>
+<% if (itag && qua !== "medium" && qua !== "sdonly") { %>
<%
- // Check if ultrahigh sources (2K) exist
- let uhdAvailable = false;
- VideoData.adaptiveFormats.forEach(format => {
- if (format.itag == '400' || format.itag == '271') {
- uhdAvailable = true;
- }
- });
-
- // Check if 4K sources exist
- let fourKAvailable = false;
- VideoData.adaptiveFormats.forEach(format => {
- if (format.itag == '313' || format.itag == '401') {
- fourKAvailable = true;
- }
- });
+ let hasHD = VideoData.adaptiveFormats.some(f => f.itag == '136' || f.itag == '298');
+ let has2K = VideoData.adaptiveFormats.some(f => f.itag == '400' || f.itag == '271');
+ let has4K = VideoData.adaptiveFormats.some(f => f.itag == '313' || f.itag == '401');
+ let onlySD = !hasHD && !has2K && !has4K;
%>
-<% if (!qua) { %>
-
High Definition
-
Standard Definition
- <% if (uhdAvailable) { %>
-
2K Definition
+
+
+<% if (!a) { %>
+
+
<% } %>
-<% if (qua === "medium") { %>
-
High Definition
-
Standard Definition
- <% if (uhdAvailable) { %>
-
2K Definition
+