In this blog, I will talk about one of the requirements related to YouTube integration. Here's the context. Your customer will publish RSS feed and your customer does not want to manually log into YouTube site and upload. The customer wants the uploading activity to be automated. He wants you to design loosely coupled application.
This is one of the typical integration requirements in the media space. Google provides YouTube APIs through which one can build stand-alone application.
Here is one of the solutions that can be implemented. In this case, design a stand-alone YouTubeUploader application that can be scheduled through Cron job. While YouTube enables developers with APIs, authentication mechanisms, client libraries, it is important to segregate roles and responsiblity of your classes. In my solution, I will make YouTubeUploader as main class which can be scheduled through cron job. This class invokes FeedParser which can access feed through http URL. Usually, the publishers now a days, use MRSS feed to syndicate the content.
Let your FeedParser parse the MRSS feed and persist in database to make sure that duplicate entries are not persisted. Develop MediaContentDownloader to download the binary content through http URL into temporary folder. Finally, develop MediaContentUploader to upload the binary content to YouTube site. Make sure to define the customer specific configuration with regard to YouTube credentials, Feed URL.
Some tips for YouTube direct Upload.
1. Use ClientLogin authentication
2. Use direct and resumeable method (first request for Upload with metadata and subsequent requests for uploading actual binary content)
3. Persist target 'Location' in a database, so that this can be used while resuming upload
4. For duplicate content check, one can produce md5 digest and persist in the database against an entry. Before uploading, make sure to create md5 digest and verify against the md5 digests persisted in the database. However, this process may have implications on performance.
Deployment diagram for your reference ...
This is one of the typical integration requirements in the media space. Google provides YouTube APIs through which one can build stand-alone application.
Here is one of the solutions that can be implemented. In this case, design a stand-alone YouTubeUploader application that can be scheduled through Cron job. While YouTube enables developers with APIs, authentication mechanisms, client libraries, it is important to segregate roles and responsiblity of your classes. In my solution, I will make YouTubeUploader as main class which can be scheduled through cron job. This class invokes FeedParser which can access feed through http URL. Usually, the publishers now a days, use MRSS feed to syndicate the content.
Let your FeedParser parse the MRSS feed and persist in database to make sure that duplicate entries are not persisted. Develop MediaContentDownloader to download the binary content through http URL into temporary folder. Finally, develop MediaContentUploader to upload the binary content to YouTube site. Make sure to define the customer specific configuration with regard to YouTube credentials, Feed URL.
Some tips for YouTube direct Upload.
1. Use ClientLogin authentication
2. Use direct and resumeable method (first request for Upload with metadata and subsequent requests for uploading actual binary content)
3. Persist target 'Location' in a database, so that this can be used while resuming upload
4. For duplicate content check, one can produce md5 digest and persist in the database against an entry. Before uploading, make sure to create md5 digest and verify against the md5 digests persisted in the database. However, this process may have implications on performance.
Deployment diagram for your reference ...
Comments
Post a Comment
Thanks for your comments.