Click here to Skip to main content
Click here to Skip to main content

Ufizy Player

, 2 May 2011
Rate this:
Please Sign up or sign in to vote.
Use www.ufizy.com to listen to songs
Ufizyplayer.jpg

Introduction

I want to start with speaking about www.ufizy.com. First, I should say www.ufizy.com is totally legal and it uses legal video websites to search songs like www.youtube.com, www.dailymotion.com, etc. For example, Ufizy.com takes a link from youtube.com, then it uses the link with some string procedures. This article is about www.ufizy.com and how we can listen to songs from there. ALSO I SHOULD SAY THIS APPLICATION IS ONLY AN INTERFACE FOR UFIZY! Just for once, click www.ufizy.com and write your favorite song, then click F! button. And the searched list is in front of you. So if you see and learn how you can listen to songs with www.ufizy.com, you can listen to them with this program. I used HTMLELEMENT class for all these progresses. Please examine the code parts for wide expression.

And if you are a beginner, I want to say something else. First, open your explorer, then navigate to www.ufizy.com and just right click to this website. And click "View Page Source". You can see a code part like this (<input id = "s" type="text" ...) that means "s" is their textbox's id. We can also reach it with this id. You can see this too (<input name="dinle" type="image"...) and that means our F! button's name is "dinle" and we can reach it with this name.

HTMLELEMENT

First of all, MSDN says:

"HtmlElement represents any possible type of element in an HTML document, such as BODY, TABLE, and FORM, among others. The class exposes the most common properties you can expect to find on all elements."

And at this link, you can get detailed information about its methods. HTML elements can have children, you can reach them with Children collection. "GetAttiribute" and "SetAttiribute" methods help you to set or get any attribute or property on a specific element. "InvokeMember" method provides access to any methods in HTML documents. HTML documents can be modified or can be changed. For this, you can use "CreateElement" method of HtmlDocument.

Using the Code

HTMLELEMENT class is very useful to get tags of a website or login a website and more. First of all, we should use a webbrowser component to enter the website. When this component finishes all load progresses, then we can reach all documents of loaded website. On form load, I did this job with 'web.Navigate(http://www.ufizy.com)' method. Just look at the bottom.

My Functions

First of all, I didn't use arraylists for you to show what is happening at the back. Also functions depend on htmlelement and some stream progresses for a user list.

  private void Form1_Load(object sender, EventArgs e)
        {
            web.Navigate("http://www.ufizy.com"); //We should reach documents of website.
            lstTag.Dock = DockStyle.Fill;
            grpUst.Visible = false;
            lstTag.Items.Add("LUTFEN YÜKLENIRKEN BEKLEYINIZ..");
        }

//These code parts for Textbox and Search button of this website. And if you examine
//these codes, you can understand how you can enter your search with C#.
  foreach (HtmlElement el in web.Document.All)
            {  
                switch (el.Id)
                {
                    //innertext means the text which behind of visible website.
                    case "s": el.InnerText = txtSarkiAdi.Text; break; 
                }
            }
            foreach (HtmlElement el in web.Document.All)
            {
                switch (el.Name)
                {
                    //InvokeMember() class runs an input's method in website like "dinle".
                    case "dinle": el.InvokeMember("click"); break; 
                }
            }
// THESE 2 ROTATIONS INTEND : FIRST ENTER SONG NAME AND THEN SEARCH ! 
// BECAUSE OF THAT, THERE ARE 2 :/ 
 private void btnPlaylist_Click(object sender, EventArgs e) // FOR A PERSONAL USER LIST
        {
            if (this.Size == new Size(547, 389) && lstplaylist.Items.Count==0)
            {
                MessageBox.Show("Kayitli Listeniz Varsa Lütfen Seçiniz."); //CHECK IF 
							//THERE IS A SAVED LIST
                if (opf.ShowDialog() == DialogResult.OK) // IF NOT 
                {
                    if (opf.FileName != "" && opf.FileName != null)
                    {
                        plylststr.ListeOkuveEkle
			(opf.FileName, lstplaylistlinkler, lstplaylist);
                        playlistyol = opf.FileName;
                    }
                }
                this.Size = new Size(547, 560);
            }
            else if (lstplaylist.Items.Count>0)
            {
                this.Size = new Size(547, 560);
            }
            else
            {
                this.Size = new Size(547, 389);
            }
        } 
private void LinkVeTagAl() //The timer will help us to get "href" attiribute 
			//of songs in searched list.
        {
            HtmlElementCollection tags = web.Document.Links;
            foreach (HtmlElement item in web.Document.Links)
                lstilk.Items.Add(item.GetAttribute("href"));
            for (int i = 0; i < web.Document.Links.Count; i++)
            {
                if (tags[i].OuterText != null && Regex.IsMatch(tags[i].OuterText, 
		"[0-9]", RegexOptions.IgnoreCase))  //In "lstilk" named listbox, there 
				//are all links. We should get first Tags then links.
                    lstTag.Items.Add(tags[i].OuterText);
            }
            for (int i = 0; i < lstilk.Items.Count; i++)  //I can use an array but 
			//I prefer to do it with listbox FOR YOU to see everything!
            {
                string dnm = lstilk.Items[i].ToString();
                if (dnm.Contains("player2.php")) //In ufizy Searched song names 
					//keep on player2.php
                {
                    string[] parcalar = dnm.Split(new Char[] { '=' }, 11);
                    lstLinkler.Items.Add("http://www.ufizy.com/index.php#" + 
			parcalar[1] + "/r/!/");
                }
            }
        } 

First www.ufizy.com gets links from a legal video website like youtube, then it uses links like this http://www.ufizy.com -->First Part /#bAsA00-5KoI/ -->Second r/ -->Third !/ --> and last. So we need # and 11 character from this #. When we search in ufizy.com, then 'player2.php' holds all of these links. We should get it and just clean it up. Smile | :)

Other functions are for Playlist or other things. WebBrowser component helps us to listen to songs. I used 2 webbrowsers; the first one for search is invisible and the second one is the Player.

Please examine ufizyplayer.com zip file for the source code.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

SercanOzdemir
Team Leader Eterne
Turkey Turkey
No Biography provided
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
QuestionMy vote of 1 PinmemberAmir Jalilifard23-Sep-13 23:22 
GeneralMy vote of 5 PinmemberMember 78700106-May-11 6:51 
GeneralGood one the Idea, not the design maybe not the coding style but the idea. Pinmemberyesotaso5-May-11 5:47 
GeneralRe: Good one the Idea, not the design maybe not the coding style but the idea. [modified] PinmemberSercanOzdemir5-May-11 6:06 
GeneralMy vote of 1 Pinmembercharles henington28-Apr-11 13:46 
GeneralRe: My vote of 1 PinmemberSercanOzdemir29-Apr-11 2:09 
GeneralRe: My vote of 1 Pinmembercharles henington29-Apr-11 9:15 
GeneralRe: My vote of 1 PinmemberSercanOzdemir29-Apr-11 9:33 
GeneralRe: My vote of 1 Pinmembercharles henington2-May-11 14:42 
GeneralRe: My vote of 1 PinmemberSercanOzdemir2-May-11 23:33 
GeneralRe: My vote of 1 Pinmembercharles henington4-May-11 3:15 
GeneralRe: My vote of 1 PinmemberSercanOzdemir4-May-11 4:18 
GeneralRe: My vote of 1 Pinmembercharles henington15-May-11 4:26 
GeneralRe: My vote of 1 PinmemberSercanOzdemir15-May-11 4:51 
GeneralRe: My vote of 1 Pinmembercharles henington16-May-11 0:13 
GeneralRe: My vote of 1 PinmemberSercanOzdemir16-May-11 3:22 
GeneralA suggestion PinmemberCharles Cox27-Apr-11 20:19 
GeneralRe: A suggestion PinmemberSercanOzdemir28-Apr-11 0:16 
GeneralRe: A suggestion Pinmembercharles henington4-May-11 3:27 
GeneralMy vote of 1 Pinmemberdimzon23-Apr-11 22:24 
GeneralRe: My vote of 1 PinmemberSercanOzdemir23-Apr-11 23:32 
GeneralRe: My vote of 1 [modified] Pinmemberdimzon24-Apr-11 7:46 
GeneralRe: My vote of 1 PinmemberSercanOzdemir24-Apr-11 9:00 
GeneralMy vote of 3 PinmemberJackDanyelZ0023-Apr-11 21:54 
GeneralRe: My vote of 3 PinmemberSercanOzdemir23-Apr-11 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 3 May 2011
Article Copyright 2011 by SercanOzdemir
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid