AudioDidact\SupportedSites\YouTube
Class YouTube
Synopsis
class YouTube
extends SupportedSite
{
- // members
- private string $YouTubeBaseURL = "http://www.youtube.com/";
- // Inherited members from SupportedSite
- protected Video $video;
- // methods
- public void __construct()
- private bool setYoutubeID()
- public void downloadThumbnail()
- public void downloadVideo()
- private string getDownloadURL()
- private bool|mixed getQualityProfilesFromURL()
- private int cURLHTTPStatus()
- private bool parseYoutubeURL()
- public static void supportsURL()
- // Inherited methods from SupportedSite
- public static void supportsURL()
- public static bool|string getDuration()
- public static bool|string getDurationSeconds()
- public static bool allDownloadedVideo()
- public void allDownloaded()
- public abstract void downloadThumbnail()
- public abstract void downloadVideo()
- public void applyArt()
- public void convert()
- protected bool downloadWithPercentage()
- public Video getVideo()
- public static void echoErrorJSON()
Hierarchy
Coverage
Methods | 55.56% | 5 / 9 |
Lines | 92.9% | 144 / 155 |
Members
Methods
private
- cURLHTTPStatus() — Use cURL to get the HTTP status of a given URL
- getDownloadURL() — Gets lowest quality mp4 download url based on a given id.
- getQualityProfilesFromURL() — Returns a quality profile or false based on a url.
- parseYoutubeURL() — Parse a YouTube URL to get the video ID
- setYoutubeID() — Set YouTube ID from a given string using parseYoutubeURL
public
- __construct() — YouTube constructor. Gets the video information, checks for it in the user's feed.
- downloadThumbnail() — Download thumbnail using videoID from YouTube's image server
- downloadVideo() — Download video using download URL from Python script and then call downloadWithPercentage to actually download the video
- supportsURL()
Inherited from AudioDidact\SupportedSites\SupportedSite
protected
- downloadWithPercentage() — Download the video to $localFile with a given $url While downloading output progress to UI as JSON array
public
- allDownloaded()
- allDownloadedVideo() — Checks if all thumbnail, video, and mp3 are downloaded and have a length (ie. video or audio are not null)
- applyArt()
- convert() — Converts mp4 video to mp3 audio using ffmpeg
- downloadThumbnail()
- downloadVideo()
- echoErrorJSON()
- getDuration() — Get duration of media file from ffmpeg
- getDurationSeconds() — Get duration in seconds of media file from ffmpeg
- getVideo() — Returns the current Video object
- supportsURL()