Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for lbry.tv #23695

Open
ricketycricket69 opened this issue Jan 10, 2020 · 5 comments · May be fixed by #24284
Open

Add support for lbry.tv #23695

ricketycricket69 opened this issue Jan 10, 2020 · 5 comments · May be fixed by #24284

Comments

@ricketycricket69
Copy link

@ricketycricket69 ricketycricket69 commented Jan 10, 2020

Checklist

  • I'm reporting a new site support request
  • I've verified that I'm running youtube-dl version 2020.01.01
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that none of provided URLs violate any copyrights
  • I've searched the bugtracker for similar site support requests including closed ones

Example URLs

Description

lbry.tv is a new open-source video publishing site. The site is still a bit funky, sometimes videos load on the first try sometimes not, and sometimes they fail halfway through watching them.

@vedranmiletic
Copy link

@vedranmiletic vedranmiletic commented Feb 6, 2020

This should be fairly straightforward for someone familiar with the youtube-dl code, there is a download button with the URL: <a target="_blank" class="button button--alt" download="lbry.mp4" href="https://player.lbry.tv/content/claims/lbry-vs-youtube/e65f097b9855701945c2da6d296177dd5615e06e/stream?download=1" rel="noopener noreferrer"><span class="button__content"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon--Download"><g><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></g></svg></span></a>

@Soundtoxin
Copy link

@Soundtoxin Soundtoxin commented Feb 13, 2020

Do you think it will be possible to add account support in the future as well? You get awarded LBC for watching a video a day on the site, and rewards for watching your first 10, 50, 100 and so on videos. I prefer to watch videos with mpv+youtube-dl, but I would hate to miss out on the rewards of the site.
Speaking of grander things, I believe lbry.tv is just a client to the LBRY protocol, so if the protocol itself could be supported, that would probably open up more possibilities, including watching videos that have been removed from the site, since they still remain inside the network.
That aside, just video playback support is something that I'd be grateful for. In the meantime I could manually click a video on the site while watching the actual thing my preferred way and still gain rewards that way.

@vedranmiletic vedranmiletic linked a pull request that will close this issue Mar 7, 2020
5 of 9 tasks complete
@vedranmiletic
Copy link

@vedranmiletic vedranmiletic commented Mar 7, 2020

Do you think it will be possible to add account support in the future as well? You get awarded LBC for watching a video a day on the site, and rewards for watching your first 10, 50, 100 and so on videos. I prefer to watch videos with mpv+youtube-dl, but I would hate to miss out on the rewards of the site.

Possibly, for now I just did it the simplest way possible.

Speaking of grander things, I believe lbry.tv is just a client to the LBRY protocol, so if the protocol itself could be supported, that would probably open up more possibilities, including watching videos that have been removed from the site, since they still remain inside the network.

Yeah, that would be nice.

That aside, just video playback support is something that I'd be grateful for. In the meantime I could manually click a video on the site while watching the actual thing my preferred way and still gain rewards that way.

Give my pull request a shot and let me know if it works for you.

@FEFB-tech
Copy link

@FEFB-tech FEFB-tech commented Jul 4, 2020

If you are on linux try:

youtube-dl $(curl $1 | grep embed | sed 's/.*embed\(.*\)">.*/\1/' | cut -d '"' -f1 | awk -v prefix="https://cdn.lbryplayer.xyz/api/v2/streams/free" '{print prefix $0}')

Where $1 is the URL of the lbry.tv video you want to download. For example:

youtube-dl $(curl https://lbry.tv/@Hackernol:7/HACKITAT---9-LAYERS-OF-POLITICAL-HACKING:5?r=ATqhndQnpGqW3Sy6LhGRDxqgEMbe8Ugv | grep embed | sed 's/.*embed\(.*\)">.*/\1/' | cut -d '"' -f1 | awk -v prefix="https://cdn.lbryplayer.xyz/api/v2/streams/free" '{print prefix $0}')

You can use it along with mpv and ydtl for streaming or put that in a bash script if you want, lets say lbry.sh. So you just do:

./lbry.sh https://lbry.tv/@Hackernol:7/HACKITAT---9-LAYERS-OF-POLITICAL-HACKING:5?r=ATqhndQnpGqW3Sy6LhGRDxqgEMbe8Ugv

Hope this may help, and please excuse my poor english, bye!

@Tamaranch
Copy link

@Tamaranch Tamaranch commented Jul 17, 2020

A small bash function based on what @FEFB-tech proposed, but using xmllint and extracting also the title and video type:

lbryoutube-dl() {
  local -a a
  mapfile -t a < <(xmllint --html --xpath '
    concat(
      concat("https://cdn.lbryplayer.xyz/api/v2/streams/free/",
             substring-after(//meta[@property="og:video"]/@content, "/embed/"))
      , "'$'\n''"
      , string(//meta[@property="og:title"]/@content)
      , "'$'\n''"
      , substring-after(//meta[@property="og:video:type"]/@content, "video/")
    )
    ' <(curl -sS "$1"))
  youtube-dl -o "$HOME/${a[1]}-%(id)s.${a[2]}" "${a[0]}"
}

You can adapt the path where youtube-dl saves the file at the last line, to suit your needs, and put this function in your .bashrc.

@ytdl-org ytdl-org deleted a comment from kauffj Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants
You can’t perform that action at this time.