Answer to query 1:
Yes , you can get the URL of the video played in the official YouTube app. You are trying to integrate your application with the YouTube application, and there is a standard way to achieve it in Android. You can get detailed information about the method here .
Currently, the problem is that the YouTube app is providing a URL that can be retrieved from other apps. This requires the concept of content providers ( here.) You can integrate any application with another application, but it is limited only by the data provided by the parent application. The YouTube app allows you to retrieve the metadata of the currently playing video.
This has more to do with Android than with the YouTube API, as you are trying to get information about the current state of the YouTube app.
Answer to query 2:
Yes , it will be illegal to develop such an application in accordance with YouTube’s terms and services. However, you are not allowed to publish your application on the Google PlayStore . To indicate YouTube’s terms and services:
"You must not download any Content unless you see the" download "or a similar link displayed by YouTube on the Service for this content. You must not copy, reproduce, make available via the Internet or electronically transmission, publication, adaptation, distribution , transfer, broadcast, display, sell, license or otherwise use any content for any other purpose without the prior written consent of YouTube or the respective licensees of the Content. YouTube and its licensors remain lyayut reserves all rights not expressly granted in the Service and Content. "
Read more about YouTube’s terms and services here .
Why do you still need to develop applications like app?
Although it would be illegal to obtain financial benefits from such an application, since it violates the terms and services of another application on which everything depends, it would still be legal to develop such an application for personal use only . After re-quoting the terms and services:
Content is provided to you as IS. You can access the Content for your information and personal use only in accordance with the provided functionality of the Service and permitted in accordance with these Terms of Service. You should not upload any Content until you see the “download” or similar link displayed by YouTube in the Service for that Content. You must not copy, reproduce, provide online or electronically the transmission, publication, adaptation, distribution, transmission, broadcast, display, sale, license, or other use of any Content for any other purpose without the prior written consent of YouTube or the relevant content licensors. YouTube and its licensors reserve all rights not expressly granted in the Service and Content.
The discussion point at this stage could be: Is YouTube a service or a content provider? You can argue on both sides.