AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Google drive file stream4/6/2023 ![]() Your download link should be in this format: Open it in a new tab and copy the file ID. Access Google Drive and find the file you wish to stream. You may be prompted to create a new project. By visiting this link, you can generate an API key to access Google Drive. You can visit this link to enable the Google Drive API. Make sure you are signed into the Google account you wish to stream files from. NET support and extensive documentation on how to setup your projects. The Google Drive API allows you to upload and download to your Google Drive from the server-side of your web applications and even through command line and desktop applications. This method is much easier than Google Drive's. The only downfall is that seeking doesn't always work since the file is technically being downloaded and played at the same time. The result would be Internet Explorer asking you to save the video. In this example, Internet Explorer is launched and the link is parsed. Then, it is split by commas since and whatever chunk contains is extracted and all " are replaced. The code above simply downloads the source code from that link you obtained earlier. ![]() Process.Start("iexplore.exe", downloadLink) ![]() If (chunk.Contains(""))ĭownloadLink = chunk.Replace("\"", string.Empty) Source = webClient.DownloadString(link_from_above) The following example is a C# example that fetches the download link from any of the links in the format above: var source = "" Get the download link from the server-side. This is simple: right-click the video and copy the address. Get the shareable link to an individual video. Ensure that is the case above the generate shareable link. It is crucial to ensure that only YOU can add videos to this album. Selecting that will allow you to get the shareable link of the album. In the top-right, there is a sharing button. Name it accordingly and then drag videos or select existing content that you have already uploaded. Then, do the following:Ĭreate a new album. To get started, start by uploading a video file of any size. Google Photos allows for free storage with no limit, given that you allow Photos to compress your videos so that they don't use up your quota on Google Drive. Keep in mind that this process should happen from the server side.Īdditionally, I recommend using Google Photos. Copy these links and use them in your video tag. There, you will get four escaped links for 360p, 480p, 720p and 1080p. To combat this, you can preload the page where you get the link from for the client and then obtain the source and search for a JSON array starting fmt_map_stream in the Google Drive source. This means that the link that you get won't necessarily work on someone else's device. It is important to be aware that each URL is actually associated with the client's IP. From there on, you will see the links to the videos and be able to copy them. Usually, it is categorised as media so you can filter out every request that refers to a media file. You may have to refresh the page and start playback before the video comes up in the network tab. They can be accessed by either right-clicking on the web page and selecting inspect element and then clicking on the network tab or by using the built-in browser menus. This is the most satisfying part: Īlternatively, you can use the network inspection tools that are readily available in the developer tools. Select copy video address and to test it out, paste it in a new tab and see if the video plays. Right-click again and you will see the browser built-in menu with options like copy video address or save video. Here's the fun part: right-click on the video player and you will see the built-in menu with options like loop and stats for nerds. Click play to make sure the quality changed. Use the Google Drive player and select your desired quality like 1080p or 720p. Please use either Firefox or Chrome for the next few steps. Just paste the link you obtained from the previous step into your web browser. This can be done by right-clicking the video in Google Drive and clicking the get shareable link button. ![]() It took me a while to figure this out so here it is: You can actually stream Google Drive video using the HTML 5 video tag regardless of the size. The method you used above is only valid for a file that is 100MB or smaller. ![]()
0 Comments
Read More
Leave a Reply. |