Jump to content

Invidious - open source Youtube frontend


Recommended Posts

Quote

Invidious is a free and open-source alternative frontend to YouTube. It is available as a Docker container, or from the GitHub master branch. It is intended to be used as a lightweight and "privacy-respecting" alternative to the official YouTube website. Invidious does not use the official YouTube API, but scrapes the website for video and metadata such as likes and views. This is done intentionally to decrease the amount of data shared with Google. The web-scraping tool is called the Invidious Developer API.

Wiki page: https://en.wikipedia.org/wiki/Invidious

Website: https://invidious.io/

API docs: https://docs.invidious.io/api/

 

By sending requests to Invidious API, you can get various information about YouTube videos, such as title, description, subtitles, available formats, direct links, and much more.

 

#include "JSON.au3"

;URL for sorted JSON list of API instances
Const $INVAPI_INSTANCE_LIST_URL = "https://api.invidious.io/instances.json?sort_by=type,api,users"

;Get list of API instances
$sResponse = BinaryToString(InetRead($INVAPI_INSTANCE_LIST_URL))

;Parse response and get first URL from list
$sFirstInstanceURL = (_JSON_Parse($sResponse)[0])[1].uri

;API request
Const $TEST_YOUTUBE_VIDEO_ID = "aqz-KE-bpKQ"
$sResponse = BinaryToString(InetRead($sFirstInstanceURL & "/api/v1/videos/" & $TEST_YOUTUBE_VIDEO_ID & "?fields=videoId,title,description"))

;Parse response and output it
$JsonData = _JSON_Parse($sResponse)
MsgBox(64, "Info", _
    "Video ID: <" & ($JsonData).videoId & ">" & @CRLF & @CRLF & _
    "Title: <" & ($JsonData).title & ">" & @CRLF & @CRLF & _
    "Description: <" & ($JsonData).description & ">")

invidious_response.png.1b66afda92cd19a301715935e4232ea5.png

 

For this example I used AspirinJunkie's JSON UDF.

 

Edited by Nisteo
Link to post
Share on other sites
  • Nisteo changed the title to Invidious - open source Youtube frontend

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Nessie
      Here is another UDF! With YTAPI you can easily use the YouTube api to get all the info that you need for a specific YouTube video.

      This UDF will not retrive to you the video download link!, Remember that download video from YouTube is illegal

      If you will find any bug, have suggestion or you want other function please just let me know!

      All supported function:

      ;_YTApi_GetVideoID ;_YTApi_GetThumbnail ;_YTApi_GetTitle ;_YTApi_GetDescription ;_YTApi_GetAuthor ;_YTApi_GetDuration ;_YTApi_GetCategory ;_YTApi_GetStats ;_YTApi_GetRating ;_YTApi_GetRatingAverange ;_YTApi_GetUploadedDate ;_YTApi_GetUpdatedDate ;_YTApi_GetAllowedCountry ;_YTApi_IsCountryAllowed
      Here is a simple Example of usage:

      #include "YTAPI.au3" $Video_ID = "dSLOR2cRouU" $Video_Thumbnail = _YTApi_GetThumbnail($Video_ID) If Not @error Then MsgBox(0, "Thumbnail", "You can see the video thumbnail at this address:" & @CRLF & $Video_Thumbnail) EndIf $Video_Author = _YTApi_GetAuthor($Video_ID) If @error Then MsgBox(0, "Author", "The video author is: " & $Video_Author) EndIf $Video_Duration = _YTApi_GetDuration($Video_ID) If Not @error Then MsgBox(0, "Duration", "The video duration is: " & $Video_Duration & " seconds.") EndIf $Video_Title = _YTApi_GetTitle($Video_ID) If Not @error Then MsgBox(0, "Title", "The video title is: " & $Video_Title) EndIf $Video_Description = _YTApi_GetDescription($Video_ID) If Not @error Then MsgBox(0, "Description", "The video is: " & $Video_Description) EndIf $Video_Category = _YTApi_GetCategory($Video_ID) If Not @error Then MsgBox(0, "Category", "The video category is: " & $Video_Category) EndIf $Video_Stats = _YTApi_GetStats($Video_ID) If Not @error Then MsgBox(0, "Video Stats", "Favorite Video Count: " & $Video_Stats[0] & @CRLF & "View Count: " & $Video_Stats[1]) EndIf $Video_Rating = _YTApi_GetRating($Video_ID) If Not @error Then MsgBox(0, "Video Rating", "Dislikes: " & $Video_Rating[0] & @CRLF & "Likes: " & $Video_Rating[1]) EndIf $Video_Date = _YTApi_GetUploadedDate($Video_ID) ;Time is expressed in UTC (0)/GMT If Not @error Then MsgBox(0, "Video Upload Date", "This video was uploaded on: " & $Video_Date[0] & " at " & $Video_Date[1]) EndIf $Video_Update = _YTApi_GetUpdatedDate($Video_ID) ;Time exspressed in UTC (0)/GMT If Not @error Then MsgBox(0, "Video Update Date", "This video was updated on: " & $Video_Update[0] & " at " & $Video_Update[1]) EndIf $Video_Allowed_Country = _YTApi_GetAllowedCountry($Video_ID) If Not @error Then $allowed_txt = "" $counter = 0 For $i = 0 To UBound($Video_Allowed_Country) - 1 $allowed_txt &= $Video_Allowed_Country[$i] & " , " $counter += 1 If $counter = 10 Then $allowed_txt &= @CRLF $counter = 0 EndIf Next MsgBox(0, "Allowed Country Code", $allowed_txt) EndIf $Video_IsCountryAllowed = _YTApi_IsCountryAllowed($Video_ID, "US") If Not @error Then MsgBox(0, "Is this country code allowed?", "Country Code: 'US' is allowed!") EndIfHi!
      YTAPI v.1.0.0.rar
    • By DesireDenied
      I am trying to get _FF_Youtube_API.au3 back to work but I think I got stuck.

      This is my test code:

      #include <FF.au3> #include <_FF_Youtube_API.au3> _FFConnect() _FFTabAdd() TestPlayer() Func TestPlayer() If _FF_CreatePlayer("Mt1aJXH6AAs") Then Sleep(2000) _FF_YT("pauseVideo") _FF_YT("seekTo", 90) EndIf EndFunc Func _FF_CreatePlayer($sVIDEOID = "") Local $sHTML = '<html><head></head><body>' & _ '<object type="application/x-shockwave-flash" id="movie_player" style="width:640px; height:510px;"' & _ 'data="http://www.youtube.com/v/#VIDEOID#?autoplay=1&amp;showsearch=0&amp;' & _ 'version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1">' & _ '<param name="movie" value="http://www.youtube.com/watch?v=#VIDEOID#?autoplay=1&amp;' & _ 'showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1" />' & _ '<param name="allowFullScreen" value="true" />' & _ '<param name="allowscriptaccess" value="always" /></object>' & _ '</body></html>' $sHTML = StringReplace($sHTML, "#VIDEOID#", $sVIDEOID) If _FFWriteHTML($sHTML) Then Return 1 Else Return 0 EndIf EndFunc
      And this is what I get

      _FFConnect: OS: WIN_7 WIN32_NT 7600 _FFConnect: AutoIt: 3.3.8.1 _FFConnect: FF.au3: 0.6.0.1b-3 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 604 _FFConnect: Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1 __FFSendJavaScripts: Sending functions to FireFox .......... done __FFSend: try{gBrowser.selectedTab = gBrowser.addTab('about:blank')}catch(e){'_FFCmd_Err';}; __FFRecv: [object XULElement] - {linkedBrowser: {...}, _tPos: 9, closing: false, mOverCloseButton: false, mCorrespondingMenuitem: null, _fullyOpen: false, arrowKeysShouldWrap: false, ...} _FFLoadWait: . loaded in 98ms __FFSend: try{content.document.body.innerHTML='<html><head></head><body><object type="application/x-shockwave-flash" id="movie_player" style="width:640px; height:510px;"data="http://www.youtube.com/v/Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1"><param name="movie" value="http://www.youtube.com/watch?v=Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /></object></body></html>';}catch(e){'_FFCmd_Err';}; __FFRecv: <html><head></head><body><object type="application/x-shockwave-flash" id="movie_player" style="width:640px; height:510px;"data="http://www.youtube.com/v/Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1"><param name="movie" value="http://www.youtube.com/watch?v=Mt1aJXH6AAs?autoplay=1&amp;showsearch=0&amp;version=3&amp;showinfo=0&amp;modestbranding=1&amp;fs=1" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /></object></body></html> __FFSend: try{window.content.wrappedJSObject.document.getElementById('movie_player').pauseVideo();}catch(e){'_FF_YT_Error'} __FFRecv: _FF_YT_Error __FFSend: try{window.content.wrappedJSObject.document.getElementById('movie_player').seekTo(90,true);}catch(e){'_FF_YT_Error'} __FFRecv: _FF_YT_Error +>22:58:35 AutoIT3.exe ended.rc:0
      It seems like if Youtube wrapper can't find player object while for youtube page it works like a charm.
      Does anyone know how to solve this problem?
×
×
  • Create New...