Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- bitchute.lua - VLC bitchute.com video stream plugin
- Version 1.0.0
- This playlist extension allows VLC to play bitchute.com videos
- It translates a bitchute.com webpage url to a VLC playlist entry
- containing relevant metadata and the direct mp4 video url extracted from the webpage.
- copy this LUA script to your VLC lua playlist scripts folder.
- Path is usually ...\VLC\lua\playlist\bitchute.lua
- --]]
- -- Probe function.
- function probe()
- return (vlc.access == "http" or vlc.access == "https")
- and (string.match(vlc.path, "^www.bitchute%.com/video"))
- end
- -- Parse function.
- function parse()
- vlc.msg.info("Using BitChute Parse plugin")
- local path, url, name, description, arturl, artist, canonicalURL
- while true do
- line = vlc.readline()
- if not line then break end
- -- source webpage url
- if string.match( line, "<link id=\"canonical\"%s.+href=\"(.+)\"" ) then
- _,_,canonicalURL = string.find( line, "<link id=\"canonical\"%s.+href=\"(.+)\"" )
- -- Title of the entry
- elseif string.match( line, "<meta property=\"og:title\"" ) then
- _,_,name = string.find( line, "<meta property=\"og:title\" content=\"(.-)\"" )
- name = vlc.strings.resolve_xml_special_chars( name )
- -- still image for artwork
- elseif string.match( line, "<meta name=\"twitter:image:src\"" ) then
- arturl = string.match( line, "<meta name=\"twitter:image:src\" content=\"(.-)\"" )
- -- Artist for the entry
- elseif string.match( line, "<p class=\"owner\"><a href=\"" ) then
- artist = string.match( line, "<p class=\"owner\"><a href=\".-\">(.-)</a>" )
- -- mp4 video url to play
- elseif string.match( line, "<source src=\"(.+)%.mp4\"" ) then
- _,_,url = string.find( line, "<source src=\"(.+%.mp4)\"" )
- -- Comments get description.
- elseif string.match( line, "<meta name=\"description\"" ) then
- _,_,description = string.find( line, "<meta name=\"description\"%s-content=\"(.+)" )
- if (description ~= nil) then
- description = vlc.strings.resolve_xml_special_chars( description )
- end
- end
- end
- description = description.."\n"..canonicalURL -- add origin webpage url as new line in Comments
- path = url
- return { { path = path, name = name, description = description, arturl = arturl, artist = artist } }
- end
- --[[
- The playlist is a table of playlist items.
- A playlist item has the following members:
- .path: the item's full path / URL
- .name: the item's name in playlist (OPTIONAL)
- .title: the item's Title (OPTIONAL, meta data)
- .artist: the item's Artist (OPTIONAL, meta data)
- .genre: the item's Genre (OPTIONAL, meta data)
- .copyright: the item's Copyright (OPTIONAL, meta data)
- .album: the item's Album (OPTIONAL, meta data)
- .tracknum: the item's Tracknum (OPTIONAL, meta data)
- .description: the item's Description (OPTIONAL, meta data)
- .rating: the item's Rating (OPTIONAL, meta data)
- .date: the item's Date (OPTIONAL, meta data)
- .setting: the item's Setting (OPTIONAL, meta data)
- .url: the item's URL (OPTIONAL, meta data)
- .language: the item's Language (OPTIONAL, meta data)
- .nowplaying: the item's NowPlaying (OPTIONAL, meta data)
- .publisher: the item's Publisher (OPTIONAL, meta data)
- .encodedby: the item's EncodedBy (OPTIONAL, meta data)
- .arturl: the item's ArtURL (OPTIONAL, meta data)
- .trackid: the item's TrackID (OPTIONAL, meta data)
- .options: a list of VLC options (OPTIONAL)
- example: .options = { "run-time=60" }
- .duration: stream duration in seconds (OPTIONAL)
- .meta: custom meta data (OPTIONAL, meta data)
- A .meta field is a table of custom meta key value pairs.
- example: .meta = { ["GVP docid"] = "-5784010886294950089", ["GVP version] = "1.1", Hello = "World!" }
- --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement