-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Automatically import videos from other platforms #754
Comments
Since it's a auto import, we can assume videos previously imported have the same title as on YT. We could just check against titles for a first implementation. |
Maybe for a POC, but speaking as someone who does these sort of automated import ops at my day job (I work for a large YouTube channel) I can say that titles can and are modified after publishing, especially within the first hour after publishing. Can't we store the YouTube video ID in some form of metadata entry on the PeerTube video and look it up to see if we've already imported it? |
Ah, right :/ I guess it's not a problem to add this metadata, since it's something that doesn't need to be federated (meaning we don't break things if we add a field to the video model). My concern is more as to how to make that metadata structure broad enough to be reused for imports from the other platforms supported by youtube-dl. I guess a HashMap is fine there. |
fyi Youtube feed also provides an
But not all platforms supported by youtube-dl provides an Atom/RSS feed. Note that a unique item id is mandatory for Atom feed:
... but is optional for RSS feed:
Related: The RSS bridge project provides Atom/RSS for many websites, including video providers. In fact we could simply use the video URL as a unique identifier, it is supported by all platforms and supposed to be unique. |
URL is an elegant way to do it but canonization is a factor. Though you wouldn't run into it with auto YT import you may run into it in other components. An example is the 4-5 different ways to express a YouTube URL (YouTube.be, mobile.youtube.com/watch, gaming.youtube.com/watch, music.youtube.com/watch, YouTube.com/watch). For this reason I would recommend just having a provider and ID pair, or just "provider:providerID" format. Use .split(':', 2) to separate the two |
Hmm yes, good point. provider and providerID could be fine. Note that Vimeo and DailyMotion also officially provide feeds, where we can find video unique ids:
So we could easily implement auto-download also for these platforms. |
This is an important idea for boosting the amount of content on the Peertube network. Once included, I would go as far as to as to ask for new users channels elsewhere that they'd like to set up for auto-import, when they're registering. That way, creators from other platforms who make an account on a PeerTube instance "just to try it out" will automatically get up and running quickly and the network gets a ton of ongoing new content, even if they forget about their PeerTube channel and don't touch it again. Beyond the scope of this issue, but worth considering later, would be actually doing a full import of someone's channel (not just videos), ie their channel description, avatar etc. |
I don't think that checking against the video title/name would be good, because users can upload different videos having the same name. it's better to store the original url for the imported video and check against the imported video url. This is how it's done for the frontend when a user imports a video, but for the video-import script it doesn't set the original video url that's imported(targetUrl). So really it is a bug in the |
Next I want to work on the videos import script to be like the frontend one because, the difference really affects me in a big way. I need it to check the targetUrl instead of a name/title of the video to keep out any duplicates. |
I think using a generic target url, converted from the many different possibilities would be best instead of doing |
(Maybe out of scope but) In the meantime I personnaly use @roipoussiere's Python script with small improvement and a cron job. |
@gnouts I like your project but it would be more intuitive to have it on peertube anyway |
@gnouts I would like to report an issue (in node arguments, |
@fflorent Thanks, I set up a github clone here : https://github.com/gnouts/peertube-import |
While I remember having used this script to import a whole YT channel, I recently tried again and failed to run it for that purpose. But the documentation seems to tell that we can pass the ID of a channel: https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/tools.md#peertube-import-videosjs I also see that youtube-dl supports downloading a whole channel. I wonder if that's possible to use a cron script to automatically synchronize a YT channel. I'll investigate that but if anyone can tell me more about it, I would be very grateful! :) |
OK, so I could run the For that purpose, I opened this PR: #1991 Even if that's WIP, feedback welcome :). Florent |
Aren't all YouTube video ID's unique? If so, couldn't the import just store the YouTube video ID and then check there aren't already any videos imported with that same ID? |
@Bugsbane Yes, it has already been suggested here: #1991 (comment) But it requires more efforts for implementing this. If you are willing to contribute, please do so. I would personally appreciate this improvement :). |
I'm more than happy to contribute... however my personal skills though lie in design. UX, communications and marketing rather than coding. :P |
I actually found this issue (and multiple others) after i had almost completed a Python tool to do this, so i figured i would comment about it here. https://github.com/mister-monster/YouTube2PeerTube This is a tool that watches YouTube channels, and when new videos are found it mirrors them to a PeerTube channel. |
@mister-monster Don't hesitate to make a MR to add your script in the documentation website: https://docs.joinpeertube.org/#/use-third-party-application |
* Add external channel URL for channel update / creation (#754) * Disallow synchronisation if user has no video quota (#754) * More constraints serverside (#754) * Disable sync if server configuration does not allow HTTP import (#754) * Working version synchronizing videos with a job (#754) TODO: refactoring, too much code duplication * More logs and try/catch (#754) * Fix eslint error (#754) * WIP: support synchronization time change (#754) * New frontend #754 * WIP: Create sync front (#754) * Enhance UI, sync creation form (#754) * Warning message when HTTP upload is disallowed * More consistent names (#754) * Binding Front with API (#754) * Add a /me API (#754) * Improve list UI (#754) * Implement creation and deletion routes (#754) * Lint (#754) * Lint again (#754) * WIP: UI for triggering import existing videos (#754) * Implement jobs for syncing and importing channels * Don't sync videos before sync creation + avoid concurrency issue (#754) * Cleanup (#754) * Cleanup: OpenAPI + API rework (#754) * Remove dead code (#754) * Eslint (#754) * Revert the mess with whitespaces in constants.ts (#754) * Some fixes after rebase (#754) * Several fixes after PR remarks (#754) * Front + API: Rename video-channels-sync to video-channel-syncs (#754) * Allow enabling channel sync through UI (#754) * getChannelInfo (#754) * Minor fixes: openapi + model + sql (#754) * Simplified API validators (#754) * Rename MChannelSync to MChannelSyncChannel (#754) * Add command for VideoChannelSync (#754) * Use synchronization.enabled config (#754) * Check parameters test + some fixes (#754) * Fix conflict mistake (#754) * Restrict access to video channel sync list API (#754) * Start adding unit test for synchronization (#754) * Continue testing (#754) * Tests finished + convertion of job to scheduler (#754) * Add lastSyncAt field (#754) * Fix externalRemoteUrl sort + creation date not well formatted (#754) * Small fix (#754) * Factorize addYoutubeDLImport and buildVideo (#754) * Check duplicates on channel not on users (#754) * factorize thumbnail generation (#754) * Fetch error should return status 400 (#754) * Separate video-channel-import and video-channel-sync-latest (#754) * Bump DB migration version after rebase (#754) * Prettier states in UI table (#754) * Add DefaultScope in VideoChannelSyncModel (#754) * Fix audit logs (#754) * Ensure user can upload when importing channel + minor fixes (#754) * Mark synchronization as failed on exception + typos (#754) * Change REST API for importing videos into channel (#754) * Add option for fully synchronize a chnanel (#754) * Return a whole sync object on creation to avoid tricks in Front (#754) * Various remarks (#754) * Single quotes by default (#754) * Rename synchronization to video_channel_synchronization * Add check.latest_videos_count and max_per_user options (#754) * Better channel rendering in list #754 * Allow sorting with channel name and state (#754) * Add missing tests for channel imports (#754) * Prefer using a parent job for channel sync * Styling * Client styling Co-authored-by: Chocobozzz <me@florianbigard.com>
So, this functions now and available for instances (presumably after updates)? |
No. It will be available once v5 is out Edit : or if admin checkout the develop branch, but that's not something advised. |
When will it be released? |
Expected by the end of 2022 |
Why not something advised? |
In production, because of some bugs or unstable / broken features in develop. |
Testing takes 5 months? |
PeerTube minor releases are made every 3 months or so. Major releases are made every year. |
Is this minor? It should have really been there since the beginning, though, as doing them one by one is so tedious... |
@Seyferto Next minor release is planned for September. If you're not happy with this ETA you can use nightly builds at your own risks: https://builds.joinpeertube.org/nightly/ Complaining about the time a feature is released in a free software project without a thank you when @fflorent took a lot of its own free time to develop is quite annoying. See also the section of our FAQ regarding this kind of remark: https://joinpeertube.org/faq#peertube-does-not-contain-all-the-tools-i-need-to-manage-my-instance |
I did actually like it when I noticed it was being done, but was disappointed if it was going to be released by the end of the year... if it's next month then that is better... so, nightly has this feature? Do you suppose others' instances usually use nightlies, though, or do most people typically wait for a release? |
Actually, @fflorent told you using nightly builds are not recommended since it's considered unstable. Some admins use it, others don't. That's up to you to do so. Nightly has every commit merged. It's the "dev" branch. |
@fflorent For people wanting to help test this new feature; are you referring to active bugs with this new functionality or more as a general statement/warning? |
@emansom That's a general statement, yes :) |
@fflorent Is this being tested anywhere as of now? |
In order to simplify the PeerTube adoption from current Youtubers, it's important to simplify the importing process.
The import script is a good step in this direction, but it is possible to do better: automatically import Youtube videos, so the PeerTube import can be totally transparent for the Youtuber.
We can do this without the Youtube API, by using atom feeds:
https://www.youtube.com/feeds/videos.xml?channel_id=<channel_id>
.I'm not used with TypeScript but I wrote a small Python script as a proof-of-concept example, available here.
Used with the import script and a 5min-cronjob, a PeerTube user could feed its instance by only specifying its Youtube channel name.
Note that we also need a way to check if the video is not already on the PeerTube instance, can we provide the youtube video id in some video metadata?
The text was updated successfully, but these errors were encountered: