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

Enforce length limitation on Title & Description #67

Open
bjoern-r opened this issue Feb 14, 2019 · 2 comments
Open

Enforce length limitation on Title & Description #67

bjoern-r opened this issue Feb 14, 2019 · 2 comments

Comments

@bjoern-r
Copy link
Member

according to the documentation documentation the maximum length of the Video Title is 100 chars and the description can be 5000 chars long.
A possible fix would be to shorten the Title and Description accordingly.

@bjoern-r
Copy link
Member Author

diff --git a/voctopublish/api_client/youtube_client.py b/voctopublish/api_client/youtube_client.py
index ad66575..6f8ce7e 100644
--- a/voctopublish/api_client/youtube_client.py
+++ b/voctopublish/api_client/youtube_client.py
@@ -185,6 +185,8 @@ class YoutubeAPI:

         # limit title length to 100 (YouTube api conformity)
         metadata['snippet']['title'] = metadata['snippet']['title'][:100]
+        # limit Description length to 5000 (YouTube api conformity)
+        metadata['snippet']['description'] = metadata['snippet']['description'][:5000]

         if self.t.youtube_category:
             metadata['snippet']['categoryId'] = int(self.t.youtube_category)

@bjoern-r
Copy link
Member Author

This quickfix should be replaced by logic which truncates after a word or sentence and adds a link to the description on media.

@bjoern-r bjoern-r reopened this Feb 14, 2019
@derpeter derpeter added this to the 35c3 milestone Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants