Exemplo n.º 1
0
        public static String DownloadUrl(String Url)
        {
            // Address
            var content = Web.getContentFromUrl(Url);

            // Search string
            string          pattern = "http://ccmixter.org/content/.*?.mp3";
            MatchCollection result  = Regex.Matches(content, pattern, RegexOptions.Singleline);

            for (int ctr = 0; ctr <= result.Count - 1; ctr++)
            {
                if (!result[ctr].Value.Contains("</script>"))
                {
                    if (Log.getMode())
                    {
                        Log.println("Match: " + result[ctr].Value);
                    }

                    url = result[ctr].Value;

                    if (Log.getMode())
                    {
                        Log.println("Url : " + result[ctr].Value);
                    }

                    if (Log.getMode())
                    {
                        Log.println("********************************");
                    }
                }
            }

            return(url);
        }
Exemplo n.º 2
0
        public static List <ccMixterSearchComponents> Query(string querystring, int querypages)
        {
            items = new List <ccMixterSearchComponents>();

            // Do search
            for (int i = 1; i <= querypages; i++)
            {
                int ii = i * 15;

                // Search address
                string content = Web.getContentFromUrl("http://ccmixter.org/search?search_text=" + querystring.Replace(" ", "+") + "&search_type=any&search_in=uploads&offset=" + ii);

                // Search string
                string          pattern = "<div class=\"search_results_link\">.*?</div>";
                MatchCollection result  = Regex.Matches(content, pattern, RegexOptions.Singleline);

                for (int ctr = 0; ctr <= result.Count - 1; ctr++)
                {
                    if (Log.getMode())
                    {
                        Log.println("Match: " + result[ctr].Value);
                    }

                    title = Helper.ExtractValue(result[ctr].Value, "class=\"cc_file_link\">", "</a>");

                    if (Log.getMode())
                    {
                        Log.println("Title : " + title);
                    }

                    author = Helper.ExtractValue(
                        Helper.ExtractValue(result[ctr].Value, "<a class=\"cc_user_link\" href=\"", "/a"), ">", "<");

                    if (Log.getMode())
                    {
                        Log.println("Author : " + author);
                    }

                    url = Helper.ExtractValue(result[ctr].Value, "<a href=\"", "\" class=");

                    if (Log.getMode())
                    {
                        Log.println("Url : " + url);
                    }

                    if (Log.getMode())
                    {
                        Log.println("********************************");
                    }

                    items.Add(new ccMixterSearchComponents(title, author, url));
                }
            }

            return(items);
        }
Exemplo n.º 3
0
        public static String DownloadUrl(string Url)
        {
            string content = Web.getContentFromUrl(Url);

            if (Log.getMode())
            {
                Log.println("Content : " + content);
            }

            String URL = Helper.ExtractValue(content, "<source src=\"", "\"").Replace("amp;", "");

            if (Log.getMode())
            {
                Log.println("Url : " + URL);
            }

            if (Log.getMode())
            {
                Log.println("********************************");
            }

            return(URL);
        }
Exemplo n.º 4
0
        public static List <EroprofileSearchComponents> Query(string querystring, int querypages)
        {
            items = new List <EroprofileSearchComponents>();

            // Do search
            for (int i = 1; i <= querypages; i++)
            {
                // Search address
                string content = Web.getContentFromUrl("http://www.eroprofile.com/m/videos/search?text=" + querystring.Replace(" ", "+") + "&pnum=" + i);

                // Search string
                string          pattern = "<div class=\"video\">.*?</span> <a href=.*?</a></div></div>";
                MatchCollection result  = Regex.Matches(content, pattern, RegexOptions.Singleline);

                for (int ctr = 0; ctr <= result.Count - 1; ctr++)
                {
                    if (Log.getMode())
                    {
                        Log.println("Match: " + result[ctr].Value);
                    }

                    title = Helper.ExtractValue(result[ctr].Value, "videoTtl", "</div><div class");
                    title = Helper.Concat(title, "\"");
                    title = Helper.ExtractValue(title, "\">", "\"");

                    if (Log.getMode())
                    {
                        Log.println("Title : " + title);
                    }

                    duration = Helper.ExtractValue(result[ctr].Value, "\"videoDur\">", "</div></a> <");

                    if (Log.getMode())
                    {
                        Log.println("Duration : " + duration);
                    }

                    url = Helper.Concat("http://www.eroprofile.com", Helper.ExtractValue(result[ctr].Value, "><div><a href=\"", "\" class=\"cbox\""));

                    if (Log.getMode())
                    {
                        Log.println("Url : " + url);
                    }

                    thumbnail = Helper.Concat("http://", Helper.ExtractValue(result[ctr].Value, "src=\"//", "\" class=\"vi").Replace("amp;", ""));

                    if (Log.getMode())
                    {
                        Log.println("Thumbnail : " + thumbnail);
                    }

                    if (Log.getMode())
                    {
                        Log.println("********************************");
                    }

                    EroprofileSearchComponents comp = new EroprofileSearchComponents(title, duration, url, thumbnail);

                    items.Add(comp);
                }
            }

            return(items);
        }
Exemplo n.º 5
0
        public static String DownloadUrl(String url)
        {
            StringBuilder sb = new StringBuilder(url);

            sb.Insert(27, "json/");
            sb.Append("?fields=title,stream_h264_url,stream_h264_ld_url,stream_h264_hq_url,stream_h264_hd_url,stream_h264_hd1080_url");

            String JUrl = sb.ToString();

            String content = Web.getContentFromUrl(JUrl);

            if ((content == null) || (String.IsNullOrEmpty(content)))
            {
                return(String.Empty);
            }

            JToken videourl = null;

            try
            {
                var obj = JObject.Parse(content.ToString());

                videourl = obj["stream_h264_hq_url"];

                if ((videourl == null) || (String.IsNullOrEmpty((string)videourl)) || (videourl.Equals(null)))
                {
                    videourl = obj["stream_h264_ld_url"];
                }
                if ((videourl == null) || (String.IsNullOrEmpty((string)videourl)) || (videourl.Equals(null)))
                {
                    videourl = obj["stream_h264_url"];
                }
                if ((videourl == null) || (String.IsNullOrEmpty((string)videourl)) || (videourl.Equals(null)))
                {
                    videourl = obj["stream_h264_hd1080_url"];
                }
                if ((videourl == null) || (String.IsNullOrEmpty((string)videourl)) || (videourl.Equals(null)))
                {
                    videourl = obj["stream_h264_hd_url"];
                }
                if ((videourl == null) || (String.IsNullOrEmpty((string)videourl)) || (videourl.Equals(null)))
                {
                    videourl = null;
                }
            }
            catch (Exception ex)
            {
                if (Log.getMode())
                {
                    Log.println(ex.ToString());
                }
            }

            if (videourl != null)
            {
                if (Log.getMode())
                {
                    Log.println("Video url: " + (string)videourl);
                }

                if (Log.getMode())
                {
                    Log.println("********************************");
                }

                return((string)videourl);
            }
            else
            {
                return(String.Empty);
            }
        }
Exemplo n.º 6
0
        public static List <DailymotionSearchComponents> Query(string querystring, int querypages)
        {
            items = new List <DailymotionSearchComponents>();

            string content = Web.getContentFromUrl("https://api.dailymotion.com/videos?search=" + querystring.Replace(" ", "+") + "&limit=" + querypages * 15);

            try
            {
                if (Log.getMode())
                {
                    Log.println("Source : " + content);
                }

                var obj = JObject.Parse(content.ToString());

                foreach (JObject element in obj["list"])
                {
                    title = (string)element["title"];

                    if (Log.getMode())
                    {
                        Log.println("Title : " + title);
                    }

                    author = (string)element["owner"];

                    if (Log.getMode())
                    {
                        Log.println("Author : " + author);
                    }

                    if (Log.getMode())
                    {
                        Log.println("********************************");
                    }

                    url = "http://www.dailymotion.com/video/" + (string)element["id"];

                    if (Log.getMode())
                    {
                        Log.println("Url : " + url);
                    }

                    if (Log.getMode())
                    {
                        Log.println("********************************");
                    }

                    DailymotionSearchComponents comp = new DailymotionSearchComponents(title, author, url);

                    items.Add(comp);
                }

                return(items);
            }
            catch (Exception ex)
            {
                if (Log.getMode())
                {
                    Log.println(ex.ToString());
                }

                return(items);
            }
        }
Exemplo n.º 7
0
        public static List <YouTubeSearchComponents> Query(string querystring, int querypages)
        {
            items = new List <YouTubeSearchComponents>();

            // Do search
            for (int i = 1; i <= querypages; i++)
            {
                // Search address
                string content = Web.getContentFromUrl("https://www.youtube.com/results?search_query=" + querystring + "&page=" + i);

                // Search string
                string          pattern = "<div class=\"yt-lockup-content\">.*?title=\"(?<NAME>.*?)\".*?</div></div></div></li>";
                MatchCollection result  = Regex.Matches(content, pattern, RegexOptions.Singleline);

                for (int ctr = 0; ctr <= result.Count - 1; ctr++)
                {
                    if (Log.getMode())
                    {
                        Log.println("Match: " + result[ctr].Value);
                    }

                    // Title
                    title = result[ctr].Groups[1].Value;

                    if (Log.getMode())
                    {
                        Log.println("Title: " + title);
                    }

                    // Author
                    author = Helper.ExtractValue(result[ctr].Value, "/user/", "class").Replace('"', ' ').TrimStart().TrimEnd();

                    if (Log.getMode())
                    {
                        Log.println("Author: " + author);
                    }

                    // Description
                    description = Helper.ExtractValue(result[ctr].Value, "dir=\"ltr\" class=\"yt-uix-redirect-link\">", "</div>");

                    if (Log.getMode())
                    {
                        Log.println("Description: " + description);
                    }

                    // Duration
                    duration = Helper.ExtractValue(Helper.ExtractValue(result[ctr].Value, "id=\"description-id-", "span"), ": ", "<").Replace(".", "");

                    if (Log.getMode())
                    {
                        Log.println("Duration: " + duration);
                    }

                    // Url
                    url = string.Concat("http://www.youtube.com/watch?v=", Helper.ExtractValue(result[ctr].Value, "watch?v=", "\""));

                    if (Log.getMode())
                    {
                        Log.println("Url: " + url);
                    }

                    // Thumbnail
                    thumbnail = "https://i.ytimg.com/vi/" + Helper.ExtractValue(result[ctr].Value, "watch?v=", "\"") + "/mqdefault.jpg";

                    if (Log.getMode())
                    {
                        Log.println("Thumbnail: " + thumbnail);
                    }

                    if (Log.getMode())
                    {
                        Log.println("********************************");
                    }

                    // Remove playlists
                    if (title != "__title__")
                    {
                        if (duration != "")
                        {
                            // Add item to list
                            items.Add(new YouTubeSearchComponents(title, author, description, duration, url, thumbnail));
                        }
                    }
                }
            }

            return(items);
        }