Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************************************
- *** 40k's Xyplorer Youtube script 0.4 ***
- *** ***
- *** Special thanks to forum users Marco, Highend and klownboy ***
- *** for their troubleshooting with video titles. ***
- *** ***
- *** IF YOU PLAN TO USE THE VLC FEATURES OF THIS SCRIPT: ***
- *** - Enable permanent variables OR hard code vlc path in $p_VLC ***
- *** ***
- *** LIMITATION: ***
- *** - As of Xyplorer 12.30 a download file size limit of 100mb is ***
- *** in place for "Get Full Video - Xyplorer". This is an Xyplorer ***
- *** limitation and may get resolved in future versions of XY. ***
- *** ***
- *** ADVICE: ***
- *** - Use VLC features of this script if you want to download ***
- *** videos larger than 100mb in size. It will work. ***
- *** ***
- *** - 40k ***
- ************************************************************************/
- "Get Full Video - Xyplorer"
- {
- /* VARIABLES */
- // "Get Full Video - Xyplorer" globals
- global $g_Menu;
- global $g_AvailableQualities;
- // "_RegEx_Iso" globals
- global $g_RegEx_Haystack;
- global $g_RegEx_Needles;
- global $g_RegEx_Marker;
- global $g_RegEx_Result;
- //Variables called $YoutubeSource_XYZ contain original Youtube source code
- // Initialize variables that need to be empty before first use
- $ParsedQualities = "";
- $g_AvailableQualities = "";
- /* Read Youtube video page content */
- if (regexmatches (<clipboard>, "http[s]?://www\.youtube\.com[^ ]+", "", "0")){
- $YoutubeSource_URL = <clipboard>;
- } else {
- $YoutubeSource_URL = input ("Youtube", "Paste Youtube video URL here", "", "s", "", "300", "200");
- }
- $YoutubeSource_All = readurl ("$YoutubeSource_URL");
- /* Find the video title */
- $VideoTitle = regexmatches ($YoutubeSource_All, "<title>.+<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, "<title>|<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, " - Youtube", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, ""|"", '"', "0");
- $VideoTitle = replacelist($VideoTitle, "&,&,',',<,<,>,>", "&,&,',',<,<,>,>", ",");
- $VideoTitle = replacelist($VideoTitle, "/,\,:,*,?,<,>,|", "", ",");
- /* Isolate different quality maps. Quality maps are delimited by "|" in $YoutubeSource_QualityMap */
- $g_RegEx_Haystack = $YoutubeSource_All;
- $g_RegEx_Needles = quote("url_encoded_fmt_stream_map"": ""[^""]*", "0")."~"."\w+=[^,]+";
- $g_RegEx_Marker = "~";
- sub "_RegEx_Iso";
- $YoutubeSource_QualityMap = $g_RegEx_Result;
- /* Isolate available qualities */
- foreach ($Quality, $YoutubeSource_QualityMap, "|"){
- // Decode URL and replace \\u0026 and "sig"
- $Quality = urldecode ($Quality, "1");
- $Quality = regexreplace ($Quality, "\\u0026", "&", "0");
- $Quality = regexreplace ($Quality, "sig", "signature", "0");
- // Youtube URL generation is dynamic. First make sure "http://..." is at start of URL
- // Note that http://...?parameter=xyz will contain 1 URL parameter that does not start with &
- $Quality = regexreplace ($Quality, "[&]?url=", "", "0");
- $Http = regexmatches ($Quality, "http:[^&]+", "|", "0");
- $Quality = $Http.regexreplace ($Quality, "http:[^&]+", "", "0");
- // Find URL specific itag value, isolate, and replace with single occurence of "itag=..."
- $Itag = regexreplace (regexmatches ("$Quality", "[&]?itag=\d{1,3}", "@", "0"),"[&]?itag=|@[&]?itag=\d+","","0");
- $Quality = regexreplace ($Quality, "[&]?(type|quality|itag|fallback_host)=[^&]+", "", "0")."&itag=$Itag";
- $ParsedQualities = $ParsedQualities.$Quality."|";
- $g_AvailableQualities = $g_AvailableQualities.$Itag."|";
- }
- sub "_IdentItag";
- $RequestedVideos = inputselect ("Youtube.com", $g_Menu, "|", "0", , "300", , );
- // The script currently processes one video at a time.
- // This foreach loop has been implemented with the goal of supporting processing of multiple videos
- // one after the other (Batch style) in future versions of this script
- foreach ($Video, $RequestedVideos, "|"){
- $Itag = replacelist(regexmatches ($Video, "\[\d+\]", "", "0"), "[,]", "", "", "0");
- $VideoExt = recase(regexmatches ($Video, "3GP|FLV|MP4|WebM", "", "0"), "l", );
- $Url = regexmatches ($ParsedQualities, "[^|]*itag=$Itag[^|]*", "", "0");
- writefile ("$VideoTitle.$VideoExt", readurl($Url), "o", "b");
- }
- }
- "Get Full Video - VLC"
- {
- /* VARIABLES */
- global $p_VLC;
- if ($p_VLC == ""){
- $p_VLC = inputfile("<curpath>", "exe", "Select vlc.exe - Please ENABLE PERMANENT VARIABLES");
- perm $p_VLC;
- }
- // "Get Full Video - VLC" globals
- global $g_Menu;
- global $g_AvailableQualities;
- // "_RegEx_Iso" globals
- global $g_RegEx_Haystack;
- global $g_RegEx_Needles;
- global $g_RegEx_Marker;
- global $g_RegEx_Result;
- //Variables called $YoutubeSource_XYZ contain original Youtube source code
- // Initialize variables that need to be empty before first use
- $ParsedQualities = "";
- $g_AvailableQualities = "";
- /* Read Youtube video page content */
- if (regexmatches (<clipboard>, "http[s]?://www\.youtube\.com[^ ]+", "", "0")){
- $YoutubeSource_URL = <clipboard>;
- } else {
- $YoutubeSource_URL = input ("Youtube", "Paste Youtube video URL here", "", "s", "", "300", "200");
- }
- $YoutubeSource_All = readurl ("$YoutubeSource_URL");
- /* Find the video title */
- $VideoTitle = regexmatches ($YoutubeSource_All, "<title>.+<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, "<title>|<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, " - Youtube", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, ""|"", '"', "0");
- $VideoTitle = replacelist($VideoTitle, "&,&,',',<,<,>,>", "&,&,',',<,<,>,>", ",");
- $VideoTitle = replacelist($VideoTitle, "/,\,:,*,?,<,>,|", "", ",");
- /* Isolate different quality maps. Quality maps are delimited by "|" in $YoutubeSource_QualityMap */
- $g_RegEx_Haystack = $YoutubeSource_All;
- $g_RegEx_Needles = quote("url_encoded_fmt_stream_map"": ""[^""]*", "0")."~"."\w+=[^,]+";
- $g_RegEx_Marker = "~";
- sub "_RegEx_Iso";
- $YoutubeSource_QualityMap = $g_RegEx_Result;
- /* Isolate available qualities */
- foreach ($Quality, $YoutubeSource_QualityMap, "|"){
- // Decode URL and replace \\u0026 and "sig"
- $Quality = urldecode ($Quality, "1");
- $Quality = regexreplace ($Quality, "\\u0026", "&", "0");
- $Quality = regexreplace ($Quality, "sig", "signature", "0");
- // Youtube URL generation is dynamic. First make sure "http://..." is at start of URL
- // Note that http://...?parameter=xyz will contain 1 URL parameter that does not start with &
- $Quality = regexreplace ($Quality, "[&]?url=", "", "0");
- $Http = regexmatches ($Quality, "http:[^&]+", "|", "0");
- $Quality = $Http.regexreplace ($Quality, "http:[^&]+", "", "0");
- // Find URL specific itag value, isolate, and replace with single occurence of "itag=..."
- $Itag = regexreplace (regexmatches ("$Quality", "[&]?itag=\d{1,3}", "@", "0"),"[&]?itag=|@[&]?itag=\d+","","0");
- $Quality = regexreplace ($Quality, "[&]?(type|quality|itag|fallback_host)=[^&]+", "", "0")."&itag=$Itag";
- $ParsedQualities = $ParsedQualities.$Quality."|";
- $g_AvailableQualities = $g_AvailableQualities.$Itag."|";
- }
- sub "_IdentItag";
- $RequestedVideos = inputselect ("Youtube.com", $g_Menu, "|", "0", , "300", , );
- // The script currently processes one video at a time.
- // This foreach loop has been implemented with the goal of supporting processing of multiple videos
- // one after the other (Batch style) in future versions of this script
- foreach ($Video, $RequestedVideos, "|"){
- $Itag = replacelist(regexmatches ($Video, "\[\d+\]", "", "0"), "[,]", "", "", "0");
- $VideoExt = recase(regexmatches ($Video, "3GP|FLV|MP4|WebM", "", "0"), "l", );
- $Url = regexmatches ($ParsedQualities, "[^|]*itag=$Itag[^|]*", "", "0");
- $VLCcommand = quote("$p_VLC", "0")." --sout=#file{""dst=$VideoTitle.$VideoExt""} :sout-keep ".quote("$Url", "0")." vlc://quit";
- run($VLCcommand, , );
- }
- }
- "Get Audio Only - VLC"
- {
- /* VARIABLES */
- global $p_VLC;
- if ($p_VLC == ""){
- $p_VLC = inputfile("<curpath>", "exe", "Select vlc.exe - Please ENABLE PERMANENT VARIABLES");
- perm $p_VLC;
- }
- // "Get Audio Only - VLC" globals
- global $g_Menu;
- global $g_AvailableQualities;
- // "_RegEx_Iso" globals
- global $g_RegEx_Haystack;
- global $g_RegEx_Needles;
- global $g_RegEx_Marker;
- global $g_RegEx_Result;
- //Variables called $YoutubeSource_XYZ contain original Youtube source code
- // Initialize variables that need to be empty before first use
- $ParsedQualities = "";
- $g_AvailableQualities = "";
- /* Read Youtube video page content */
- if (regexmatches (<clipboard>, "http[s]?://www\.youtube\.com[^ ]+", "", "0")){
- $YoutubeSource_URL = <clipboard>;
- } else {
- $YoutubeSource_URL = input ("Youtube", "Paste Youtube video URL here", "", "s", "", "300", "200");
- }
- $YoutubeSource_All = readurl ("$YoutubeSource_URL");
- /* Find the video title */
- $VideoTitle = regexmatches ($YoutubeSource_All, "<title>.+<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, "<title>|<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, " - Youtube", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, ""|"", '"', "0");
- $VideoTitle = replacelist($VideoTitle, "&,&,',',<,<,>,>", "&,&,',',<,<,>,>", ",");
- $VideoTitle = replacelist($VideoTitle, "/,\,:,*,?,<,>,|", "", ",");
- /* Isolate different quality maps. Quality maps are delimited by "|" in $YoutubeSource_QualityMap */
- $g_RegEx_Haystack = $YoutubeSource_All;
- $g_RegEx_Needles = quote("url_encoded_fmt_stream_map"": ""[^""]*", "0")."~"."\w+=[^,]+";
- $g_RegEx_Marker = "~";
- sub "_RegEx_Iso";
- $YoutubeSource_QualityMap = $g_RegEx_Result;
- /* Isolate available qualities */
- foreach ($Quality, $YoutubeSource_QualityMap, "|"){
- // Decode URL and replace \\u0026 and "sig"
- $Quality = urldecode ($Quality, "1");
- $Quality = regexreplace ($Quality, "\\u0026", "&", "0");
- $Quality = regexreplace ($Quality, "sig", "signature", "0");
- // Youtube URL generation is dynamic. First make sure "http://..." is at start of URL
- // Note that http://...?parameter=xyz will contain 1 URL parameter that does not start with &
- $Quality = regexreplace ($Quality, "[&]?url=", "", "0");
- $Http = regexmatches ($Quality, "http:[^&]+", "|", "0");
- $Quality = $Http.regexreplace ($Quality, "http:[^&]+", "", "0");
- // Find URL specific itag value, isolate, and replace with single occurence of "itag=..."
- $Itag = regexreplace (regexmatches ("$Quality", "[&]?itag=\d{1,3}", "@", "0"),"[&]?itag=|@[&]?itag=\d+","","0");
- $Quality = regexreplace ($Quality, "[&]?(type|quality|itag|fallback_host)=[^&]+", "", "0")."&itag=$Itag";
- $ParsedQualities = $ParsedQualities.$Quality."|";
- $g_AvailableQualities = $g_AvailableQualities.$Itag."|";
- }
- //text $ParsedQualities;
- sub "_IdentItag";
- $RequestedVideos = inputselect ("Youtube.com", $g_Menu, "|", "0", , "300", , );
- // The script currently processes one video at a time.
- // This foreach loop has been implemented with the goal of supporting processing of multiple videos
- // one after the other (Batch style) in future versions of this script
- foreach ($Video, $RequestedVideos, "|"){
- $Itag = replacelist(regexmatches ($Video, "\[\d+\]", "", "0"), "[,]", "", "", "0");
- $VideoExt = recase(regexmatches ($Video, "3GP|FLV|MP4|WebM", "", "0"), "l", );
- $Url = regexmatches ($ParsedQualities, "[^|]*itag=$Itag[^|]*", "", "0");
- $VLCcommand = quote("$p_VLC", "0")." --sout=#transcode{vcodec=none}:file{dst=""$VideoTitle.$VideoExt""} :sout-keep ".quote("$Url", "0")." vlc://quit";
- run($VLCcommand, , );
- }
- }
- "Get Video Only - VLC"
- {
- /* VARIABLES */
- global $p_VLC;
- if ($p_VLC == ""){
- $p_VLC = inputfile("<curpath>", "exe", "Select vlc.exe - Please ENABLE PERMANENT VARIABLES");
- perm $p_VLC;
- }
- // "Get Video Only - VLC" globals
- global $g_Menu;
- global $g_AvailableQualities;
- // "_RegEx_Iso" globals
- global $g_RegEx_Haystack;
- global $g_RegEx_Needles;
- global $g_RegEx_Marker;
- global $g_RegEx_Result;
- //Variables called $YoutubeSource_XYZ contain original Youtube source code
- // Initialize variables that need to be empty before first use
- $ParsedQualities = "";
- $g_AvailableQualities = "";
- /* Read Youtube video page content */
- if (regexmatches (<clipboard>, "http[s]?://www\.youtube\.com[^ ]+", "", "0")){
- $YoutubeSource_URL = <clipboard>;
- } else {
- $YoutubeSource_URL = input ("Youtube", "Paste Youtube video URL here", "", "s", "", "300", "200");
- }
- $YoutubeSource_All = readurl ("$YoutubeSource_URL");
- /* Find the video title */
- $VideoTitle = regexmatches ($YoutubeSource_All, "<title>.+<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, "<title>|<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, " - Youtube", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, ""|"", '"', "0");
- $VideoTitle = replacelist($VideoTitle, "&,&,',',<,<,>,>", "&,&,',',<,<,>,>", ",");
- $VideoTitle = replacelist($VideoTitle, "/,\,:,*,?,<,>,|", "", ",");
- /* Isolate different quality maps. Quality maps are delimited by "|" in $YoutubeSource_QualityMap */
- $g_RegEx_Haystack = $YoutubeSource_All;
- $g_RegEx_Needles = quote("url_encoded_fmt_stream_map"": ""[^""]*", "0")."~"."\w+=[^,]+";
- $g_RegEx_Marker = "~";
- sub "_RegEx_Iso";
- $YoutubeSource_QualityMap = $g_RegEx_Result;
- /* Isolate available qualities */
- foreach ($Quality, $YoutubeSource_QualityMap, "|"){
- // Decode URL and replace \\u0026 and "sig"
- $Quality = urldecode ($Quality, "1");
- $Quality = regexreplace ($Quality, "\\u0026", "&", "0");
- $Quality = regexreplace ($Quality, "sig", "signature", "0");
- // Youtube URL generation is dynamic. First make sure "http://..." is at start of URL
- // Note that http://...?parameter=xyz will contain 1 URL parameter that does not start with &
- $Quality = regexreplace ($Quality, "[&]?url=", "", "0");
- $Http = regexmatches ($Quality, "http:[^&]+", "|", "0");
- $Quality = $Http.regexreplace ($Quality, "http:[^&]+", "", "0");
- // Find URL specific itag value, isolate, and replace with single occurence of "itag=..."
- $Itag = regexreplace (regexmatches ("$Quality", "[&]?itag=\d{1,3}", "@", "0"),"[&]?itag=|@[&]?itag=\d+","","0");
- $Quality = regexreplace ($Quality, "[&]?(type|quality|itag|fallback_host)=[^&]+", "", "0")."&itag=$Itag";
- $ParsedQualities = $ParsedQualities.$Quality."|";
- $g_AvailableQualities = $g_AvailableQualities.$Itag."|";
- }
- //text $ParsedQualities;
- sub "_IdentItag";
- $RequestedVideos = inputselect ("Youtube.com", $g_Menu, "|", "0", , "300", , );
- // The script currently processes one video at a time.
- // This foreach loop has been implemented with the goal of supporting processing of multiple videos
- // one after the other (Batch style) in future versions of this script
- foreach ($Video, $RequestedVideos, "|"){
- $Itag = replacelist(regexmatches ($Video, "\[\d+\]", "", "0"), "[,]", "", "", "0");
- $VideoExt = recase(regexmatches ($Video, "3GP|FLV|MP4|WebM", "", "0"), "l", );
- $Url = regexmatches ($ParsedQualities, "[^|]*itag=$Itag[^|]*", "", "0");
- $VLCcommand = quote("$p_VLC", "0")." --sout=#transcode{acodec=none}:file{dst=""$VideoTitle.$VideoExt""} :sout-keep ".quote("$Url", "0")." vlc://quit";
- run($VLCcommand, , );
- }
- }
- "Batch MP3 Encoder - VLC"
- /* VARIABLES */
- global $p_VLC;
- if ($p_VLC == ""){
- $p_VLC = inputfile("<curpath>", "exe", "Select vlc.exe - Please ENABLE PERMANENT VARIABLES");
- perm $p_VLC;
- }
- // "Podcast Encoder - VLC" globals
- global $g_Menu;
- global $g_AvailableQualities;
- // "_RegEx_Iso" globals
- global $g_RegEx_Haystack;
- global $g_RegEx_Needles;
- global $g_RegEx_Marker;
- global $g_RegEx_Result;
- //Variables called $YoutubeSource_XYZ contain original Youtube source code
- // Ask user to provide desired links
- $Links = input("Podcast Encoder", "Paste Youtube links of all videos you want encoded to podcast. 1 Link per line!", "", "m", "400", "600");
- /* Read Youtube video page content */
- foreach ($YoutubeSource_URL, $Links, "<crlf>"){
- // Initialize variables that need to be empty before use
- $ParsedQualities = "";
- $g_AvailableQualities = "";
- $YoutubeSource_All = readurl ($YoutubeSource_URL);
- /* Find the video title */
- $VideoTitle = regexmatches ($YoutubeSource_All, "<title>.+<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, "<title>|<\/title>", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, " - Youtube", "", "0");
- $VideoTitle = regexreplace ($VideoTitle, ""|"", '"', "0");
- $VideoTitle = replacelist($VideoTitle, "&,&,',',<,<,>,>", "&,&,',',<,<,>,>", ",");
- $VideoTitle = replacelist($VideoTitle, "/,\,:,*,?,<,>,|", "", ",");
- /* Isolate different quality maps. Quality maps are delimited by "|" in $YoutubeSource_QualityMap */
- $g_RegEx_Haystack = $YoutubeSource_All;
- $g_RegEx_Needles = quote("url_encoded_fmt_stream_map"": ""[^""]*", "0")."~"."\w+=[^,]+";
- $g_RegEx_Marker = "~";
- sub "_RegEx_Iso";
- $YoutubeSource_QualityMap = $g_RegEx_Result;
- /* Isolate available qualities */
- foreach ($Quality, $YoutubeSource_QualityMap, "|"){
- // Decode URL and replace \\u0026 and "sig"
- $Quality = urldecode ($Quality, "1");
- $Quality = regexreplace ($Quality, "\\u0026", "&", "0");
- $Quality = regexreplace ($Quality, "sig", "signature", "0");
- // Youtube URL generation is dynamic. First make sure "http://..." is at start of URL
- // Note that http://...?parameter=xyz will contain 1 URL parameter that does not start with &
- $Quality = regexreplace ($Quality, "[&]?url=", "", "0");
- $Http = regexmatches ($Quality, "http:[^&]+", "|", "0");
- $Quality = $Http.regexreplace ($Quality, "http:[^&]+", "", "0");
- // Find URL specific itag value, isolate, and replace with single occurence of "itag=..."
- $Itag = regexreplace (regexmatches ("$Quality", "[&]?itag=\d{1,3}", "@", "0"),"[&]?itag=|@[&]?itag=\d+","","0");
- $Quality = regexreplace ($Quality, "[&]?(type|quality|itag|fallback_host)=[^&]+", "", "0")."&itag=$Itag";
- $ParsedQualities = $ParsedQualities.$Quality."|";
- $g_AvailableQualities = $g_AvailableQualities.$Itag."|";
- }
- sub "_IdentItag";
- $Video = regexmatches($g_Menu, "^[^|]+", "", "0"); //We pick the highest available quality here
- $Itag = replacelist(regexmatches ($Video, "\[\d+\]", "", "0"), "[,]", "", "", "0");
- $Url = regexmatches ($ParsedQualities, "[^|]*itag=$Itag[^|]*", "", "0");
- $VLCcommand = quote("$p_VLC", "0")." --sout=#transcode{vcodec=none,acodec=mp3,ab=192,channels=2,samplerate=48000}:file{dst=""$VideoTitle.mp3""} :sout-keep ".quote("$Url", "0")." vlc://quit";
- run($VLCcommand, , "1", "1");
- }
- "_RegEx_Iso"
- {
- /*
- _RegEx_Iso is a sub script that will recursively search a text source.
- By using sequenced regular expressions it is able to isolate embedded text that you
- can not isolate using just a single regular expression.
- You must define global variables Haystack, Needles, and Marker in your script as the "arguments"
- to the "method" _RegEx_Iso.
- E.g:
- $g_RegEx_Haystack = $Source;
- $g_RegEx_Needles = "www\.youtube\.com\/user\/[^""]+"."~"."[^\/]+$";
- $g_RegEx_Marker = "~";
- sub "_RegEx_Iso";
- text $g_RegEx_Result;
- */
- global $g_RegEx_Haystack; // Text source to search in
- global $g_RegEx_Needles; // List of recursive regex to be used
- global $g_RegEx_Marker; // Delimiting character used to sequence list of regex
- global $g_RegEx_Result; // Result of the search are demarked by "|"
- $j = $g_RegEx_Haystack;
- $k = $g_RegEx_Needles;
- $l = $g_RegEx_Marker;
- foreach ($i, $k, $l){
- $j = regexmatches ("$j", "$i", "|", "0");
- }
- $g_RegEx_Result = $j;
- /*
- */
- }
- "_DEBUGRegEx_Iso"
- {
- /*
- _DEBUGRegEx_Iso will do exactly the same as "_RegEx_Iso".
- In addition it will show the Haystack, Needle, Marker and Result for each
- recursive regular expression cycle. Useful to identify buggy behavior.
- */
- global $g_RegEx_Haystack;
- global $g_RegEx_Needles;
- global $g_RegEx_Marker;
- global $g_RegEx_Result;
- $j = $g_RegEx_Haystack;
- $k = $g_RegEx_Needles;
- $l = $g_RegEx_Marker;
- foreach ($i, $k, $l){
- text "$j";
- $j = regexmatches ("$j", "$i", "|", "0");
- text "$j <crlf 2>$i <crlf 2>$l";
- }
- $g_RegEx_Result = $j;
- /*
- */
- }
- "_IdentItag"
- {
- /*
- IdentItag searches a local database for the requested itag and returns a list that is used in the
- quality selection menu
- */
- global $g_Menu;
- global $g_AvailableQualities;
- $ThreeGP =
- "
- >[36] 240p - 3GP
- >[17] 144p - 3GP
- >[13] Unknown - 3GP
- ";
- $Flv =
- "
- >[35] 480p - FLV
- >[34] 360p - FLV
- >[06] 270p - FLV
- >[05] 240p - FLV
- ";
- $Webm =
- "
- >[46] 1080p - WebM
- >[45] 720p - WebM
- >[44] 480p - WebM
- >[43] 360p - WebM
- ";
- $Mp4 =
- "
- >[38] 3072p - MP4
- >[37] 1080p - MP4
- >[22] 720p - MP4
- >[18] 360p - MP4
- ";
- $Db = replace($ThreeGP.$Flv.$Webm.$Mp4, " >", "", "0", , );
- $g_Menu = "";
- foreach ($Option, $g_AvailableQualities, "|"){
- $g_Menu = $g_Menu.regexmatches($Db, "\[[0]?$Option\][^\[]+", "", "0")."|";
- }
- /*
- */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement