Newpipe: Share playlist or export it to text or clipboard

Created on 3 Oct 2018  路  17Comments  路  Source: TeamNewPipe/NewPipe

Please add ability to Export playlists in readable text just in case Newpipe becomes blocked by YouTube and the internal playlists are inaccessible.

enhancement

Most helpful comment

It would still be prudent to add the simple ability for the user to copy all links in a specific playlist as to avoid a repeat of any future issues that traps the users playlists inside a non functional application.

In the interest of migrating data easily users would like to have a "Copy all links to Clipboard" option for playlists.

Please reconsider this request thanks.

All 17 comments

This is not an issue, if this really happens we can still create a program that can read the database.

It would still be prudent to add the simple ability for the user to copy all links in a specific playlist as to avoid a repeat of any future issues that traps the users playlists inside a non functional application.

In the interest of migrating data easily users would like to have a "Copy all links to Clipboard" option for playlists.

Please reconsider this request thanks.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Actually, it could be a useful feature. E.g. if one decided to watch a particular playlist on another device, sharing it via TrebleShot or some such might be required.
Though export of a locally created playlist to M3U, XSPF or CSV file would still require time investment, so it shouldn't be a number one priority for the developers ATM.

I think it would be a great improvement, also import playlists would be interesting.

I don't know if that's exactly what is requested here, but even if not this should be something easy to implement with huge benefit: the ability to share playlists per URL. This is possible like this:
https://www.youtube.com/watch_videos?video_ids=**ID1**,**ID2**,etc
ID means: youtube.com/watch?v=ID, so for https://www.youtube.com/watch?v=av6NhDzuphU the ID is av6NhDzuphU
Example: https://www.youtube.com/watch_videos?video_ids=av6NhDzuphU,kwv_pQUBiLU
This has a cap of 50 IDs. A link like that gets very fast very long, but when this URL gets resolved, it gets shortened (example: playlist of 50 videos: https://www.youtube.com/watch?v=kwv_pQUBiLU&list=TLGGgN4wnw6MybkxODA0MjAxOQ). I wasn't able to figure out, whether there is a pattern (and if there is none how to parse this short playlist URL). Also I didn't figure out whether there is some URL-magic to combine playlists in order to bypass the 50 video limit, maybe someone smarter will find something.
Update: Working on a PR

sql command to extract playlist from newpipe.db

select 
    url,
    title,
    stream_type,
    duration,
    uploader,
    streams.thumbnail_Url,
    playlists.name as playlist_name,
    playlists.thumbnail_url as playlist_thumbnail_url
from streams 
inner join playlist_stream_join on playlist_stream_join.stream_id = streams.uid
inner join playlists on playlists.uid == playlist_stream_join.playlist_id

i use db browser for sqlite.

  • go to execute sql
  • paste above code
  • click play button
  • export csv

Ow thank you so much 馃敟馃敟馃敟

Maybe it could be something to put in Faq for people looking for this idk

i can create a new wiki page, but maybe need better sql command as above script only tested with single playlist.

cmiiw above code only print single playlist on each stream record

for better playlist related data, it should be taken from playlist_stream_join table instead from streams table

something like this

select 
    streams.url,
    streams.title,
    streams.stream_type,
    streams.duration,
    streams.uploader,
    streams.thumbnail_Url,
    playlists.name as playlist_name,
    playlists.thumbnail_url as playlist_thumbnail_url
from playlist_stream_join 
inner join streams on playlist_stream_join.stream_id = streams.uid
inner join playlists on playlists.uid == playlist_stream_join.playlist_id
#!/usr/bin/env python3
from io import StringIO
from sqlite3 import Error
import csv
import sqlite3
import sys


def create_connection(db_file):
    """ create a database connection to the SQLite database
        specified by the db_file
    :param db_file: database file
    :return: Connection object or None
    """
    try:
        conn = sqlite3.connect(db_file)
        return conn
    except Error as e:
        print(e)

    return None


def get_rows(db_file):
    conn = create_connection(db_file)

    cmds = """
    select 
            url,
            title,
            stream_type,
            duration,
            uploader,
            streams.thumbnail_Url,
            playlists.name as playlist_name,
            playlists.thumbnail_url as playlist_thumbnail_url
    from streams 
    inner join playlist_stream_join on playlist_stream_join.stream_id = streams.uid
    inner join playlists on playlists.uid == playlist_stream_join.playlist_id
    """
    cur = conn.cursor()
    cur.execute(cmds)
    rows = cur.fetchall()
    return rows


def main(db_file):
    rows = get_rows(db_file)
    f = StringIO()
    wr = csv.writer(f)
    wr.writerow([
        'url', 'title', 'stream_type', 'duration', 'uploader',
        'stream_thumbnail_url', 'playlist_name', 'playlist_thumbnail_url'])
    for row in rows:
        wr.writerow(row)
    print(f.getvalue())


if __name__ == '__main__':
    main(sys.argv[1])

simple script to print csv of youtube video on playlist

usage:

script.py newpipe.db

+1 for the ability to share playlists with other users. It's quite painful now to copy and paste 25 links and have the other user click on each and add to their list.

BTW, can I take a moment to say how incredibly well designed and implemented NewPipe is? And how awesome it is to have a perfect alternative in the first place? Thank you for this app!

This feature would be awesome for the following reasons:
1 Using it with youtube-dl or an internet download manager
2 Easier to share multiple videos with someone
3 Having a local back-up of playlists
Especially number 1 is essential to me and is keeping me from replacing the Youtube app with Newpipe.

3719 by @andrei-belkin:

Describe the feature you want

I believe it would be great if a NewPipe user could share a playlist they made with another NewPipe user.

Some options I'm seeing are:
1 - Assigning a random public URL (maybe temporary) to the playlist.
2 - Exporting the playlist (just that playlist, not the whole NewPipe database on the device) as a JSON file and importing it on another device.
3 - Sharing the playlist in some form (maybe the same JSON file) on the local network, without actually going into the internet.

Is your feature request related to a problem? Please describe it

Say, I made a playlist and want to watch it on another device. That's impossible to do at this point in time (as of June 2nd, 2020) without having to export and import the whole NewPipe database that's stored on the device, which is a privacy threat to me.

Additional context

N/A

How will you/everyone benefit from this feature?

There are multiple use cases for such a feature. Here are some of them:

  • Sharing a playlist with a friend.
  • Watching the playlist on another device (like an Android TV or a tablet).
  • Sending the playlist to someone for a more serious matter (for example, it could be an aggregation of public videos regarding a particular topic: political speeches, TV shows, an artist album, videos serving as proof of some fact, etc).

In my case, all I want at this moment is to watch a large playlist I made (over a hundred videos) on another device (the playlist is stored on my phone and I often want to watch it on my Android TV).

Someone (palmstreet on reddit / f1nbar on GitHub) made a Java program to export your playlists:

I made a simple tool to make it a little more convenient to export your NewPipe playlists to either a YouTube or invidio.us link if anyone is interested, created it mainly for myself but I figured there may be a handful of people who'd also find it interesting. (There have been intermittent issues on invidio.us end with linking playlists at the moment)

https://github.com/f1nbar/PlaylistsForNewPipe

_Message from palmstreets on r/NewPipe_

It uses Java and has a graphical interface, it might be easier to use than the SQL or python scripts above.

I would like to add that I would like the feature should it be added to be similar to the export subscriptions function: without manipulating multiple .CSV files with custom functions, the .CSV file for playlists can be exported as immediately user-friendly data.

Maybe a function that return a simple list of links for export and import might work too. Then the user can just copy/paste/share the link list to whatever app they want.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aevann picture Aevann  路  3Comments

Hunter9888x picture Hunter9888x  路  3Comments

danialbehzadi picture danialbehzadi  路  3Comments

hassanseoul123 picture hassanseoul123  路  3Comments

cool-student picture cool-student  路  3Comments