CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Jan 2010
    Posts
    8

    need help how to write a function...

    Hey guys,

    I need a help to write such function:

    Input - string - Youtube url -
    (for example, http://www.youtube.com/watch?v=_xxxxxxxxxx

    Output - string - flv file url -
    (for example, http://xxxxxxxxxxxxxxxxxxxxxxxxx.flv)

    Please advice.
    Thanks in advance!

  2. #2
    Join Date
    Dec 2009
    Location
    Kathmandu,Nepal
    Posts
    168

    Re: need help how to write a function...

    I was not clear to your Question but Here what I've understood:
    Code:
    string Utube=" http://www.youtube.com/watch?v="
    public void uTube()
    {
       Utube += Input.Text;
       System.Diagnostics.Process.Start(Utube);
    }

  3. #3
    Join Date
    Jan 2010
    Posts
    8

    Re: need help how to write a function...

    Quote Originally Posted by rocky_upadhaya View Post
    I was not clear to your Question but Here what I've understood:
    Code:
    string Utube=" http://www.youtube.com/watch?v="
    public void uTube()
    {
       Utube += Input.Text;
       System.Diagnostics.Process.Start(Utube);
    }
    THanks for your answer. Your code is opening url.

    I need something slightly different.
    Youtube internally stores clips in .flv format.
    So, I need to write a function on C# to get the .flv path according to url - http://www.youtube.com/watch?v=xxxxxxxxx.
    So, the input of the function would be http://www.youtube.com/watch?v=xxxxxxxxx;
    the output - will be string indicating the path of .flv file.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: need help how to write a function...

    Why do you care about the internal location that youtube uses to store their files?

  5. #5
    Join Date
    Jan 2010
    Posts
    8

    Re: need help how to write a function...

    Quote Originally Posted by Arjay View Post
    Why do you care about the internal location that youtube uses to store their files?
    Because I want to write application that will save some youtube clip locally on my PC.
    To do it I need to know exact .flv file path+name.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: need help how to write a function...

    Quote Originally Posted by pushacat View Post
    Because I want to write application that will save some youtube clip locally on my PC.
    To do it I need to know exact .flv file path+name.
    I suspect that YouTube doesn't allow users to save clips locally.

    Why not ask YouTube directly?

    http://code.google.com/apis/youtube/overview.html

    At the lower right corner of the page are a few links to YouTube community sites. I bet you can find out if downloading clips is allowed, and if it is, get an answer on how to do it.

  7. #7
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: need help how to write a function...

    if downloading youtube clips is not allowed then how do I watch them? every browser saves all clips locally. it's not possible to not save them.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  8. #8
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: need help how to write a function...

    There's a difference between your browser caching data locally and saving a copy of the content...

    I think what Arjay is trying to say is that if creating this application is not against Youtube's terms of use, the community should be able to point him in the right direction. If it is against the terms, he (and I) would be reluctant to help in creating this application.
    It's not a bug, it's a feature!

  9. #9
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: need help how to write a function...

    Quote Originally Posted by foamy View Post
    I think what Arjay is trying to say is that if creating this application is not against Youtube's terms of use
    so what? I'm not a lawyer and don't have to know the terms of use of every website on the internet.

    this is the place to give/get some technical advise if possible (this time I cannot help) and if the OP does some evil things with this knowledge or brakes some terms of use I don't care.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  10. #10
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: need help how to write a function...

    Quote Originally Posted by memeloo View Post
    so what? I'm not a lawyer and don't have to know the terms of use of every website on the internet.

    this is the place to give/get some technical advise if possible (this time I cannot help)...
    we're not mindless zombies that just sit here and answer questions... we use common sense too.

    knowing the terms of use for every website on the internet is not the same as having common sense.

    you don't have to be a rocket scientist to know if someone is asking how to start a hidden application on system boot, and capture key strokes to know they're planning on writing a key logger. just use your own judgement before answering people's questions.

    ...and if the OP does some evil things with this knowledge or brakes some terms of use I don't care.
    you would care if it was you or your terms of use being violated.

  11. #11
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: need help how to write a function...

    Quote Originally Posted by mariocatch View Post
    ...if someone is asking how to start a hidden application on system boot, and capture key strokes to know they're planning on writing a key logger
    I didn't know, I have no clairvoyant abilities and if everyone would think this way we had to ban the selling of knives because the person buying it is perhaps planning to kill someone. such reasoning I just find silly. we also had to ban even speaking because you can say bad words to someone and hurt him so better we don't even learn to speak.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  12. #12
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: need help how to write a function...

    Quote Originally Posted by memeloo View Post
    I didn't know, I have no clairvoyant abilities and if everyone would think this way we had to ban the selling of knives because the person buying it is perhaps planning to kill someone. such reasoning I just find silly. we also had to ban even speaking because you can say bad words to someone and hurt him so better we don't even learn to speak.
    Well I think everyone is entitle to their opinion. Personally I do care about what others do with the information I give them. For example I like to know that I'm not wasting my time. I also like to know that they are not wasting their time by doing things in needlessly complicated ways. If I have reason to believe that person I'm about to help has dubious intentions I always ask wha they are trying to do. There is normally a good reason/explanation but I cannot assume that. And whilst my help maybe used malicious at least it will be without me knowing or being complicit with it.

    Whilst we are not accountable for what other developers do I think we have a measure of responsibility for the development community as whole. I mean that's why we are on forums like this...to learn from each other and to help others in their learning, to learn to program the right way and solve problems. New developers may not be aware of the implications of what they are attempting to do so it doesn't hurt if a few wise heads ask questions when there is indication of possible malicious intent or intent that could violate laws (e.g. copyright laws, privacy, etc)

  13. #13
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: need help how to write a function...

    Quote Originally Posted by memeloo View Post
    so what? I'm not a lawyer and don't have to know the terms of use of every website on the internet.

    this is the place to give/get some technical advise if possible (this time I cannot help) and if the OP does some evil things with this knowledge or brakes some terms of use I don't care.
    Well it's a question of moral integrity then. I would never aid anyone in creating code that violates someone's terms of use or perhaps even local law.

    nelo said it well, whether you want to admit it or not, we as a community have an inherent responsibility for what is created with our help. Therefore it is only natural that the majority of us will question the intent of some software when its purpose is not apparent.
    It's not a bug, it's a feature!

  14. #14
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: need help how to write a function...

    Quote Originally Posted by foamy View Post
    we as a community have an inherent responsibility for what is created with our help
    no we have not. why should we? let's say I have some business and I produce the mentioned knives. should I feel responsible if someone who bought my knive kills someone else? I don't think so.

    Quote Originally Posted by foamy View Post
    Therefore it is only natural that the majority of us will question the intent of some software when its purpose is not apparent.
    sure, then next time when there is a question about how to create a database connection you answer the OP that you cannot help him because he might want to steal some data from a bank or so.

    or perhaps another person wants to open/create a file and save some text in it. following your reasoning he might want to save the logged keystrokes he just captured with his keylogger. in this case any help couldn't be provided too.
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  15. #15
    Join Date
    Nov 2002
    Location
    .NET 3.5 VS2008
    Posts
    1,039

    Re: need help how to write a function...

    Quote Originally Posted by memeloo
    no we have not. why should we? let's say I have some business and I produce the mentioned knives. should I feel responsible if someone who bought my knive kills someone else? I don't think so.
    Yes you have a valid point. But there are many cases where society puts constraints to prevent people from harming themselves or causing harm to others. In some places you would not be able to buy a knife (or alcoholic drinks) unless you are above a certain age. The shop owner has the responsibility of checking the person's age if he/she has reason to believe that they are under age. If the person is of legal age they just show their id and the seller is happy to sell them the knife or alcohol knowing he has complied the law in that society (personally I think this is good sense even if there is no law)

    Quote Originally Posted by memeloo
    sure, then next time when there is a question about how to create a database connection you answer the OP that you cannot help him because he might want to steal some data from a bank or so.
    When you speak like this it seems like you just want to keep the argument going. There is nothing suspicious about someone asking how to connect to a database. But if someone asks how to write some script to put on a web page that can lookup the databases on a client machine and connect them I think there is reason to be suspicious of the person's intentions.

    Nobody is saying don't help people open files, connect to databases, keep track of user interactions. What most of us (I mean the ones on this particular thread) are trying to say is that we would be relunctant to help someone if we had reason to believe (without the need for clairvoyance or other supernatural means) the person is attempting to do something unlawful.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured