1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 16:06:49 +00:00

Switch trim method

This commit is contained in:
palewire 2022-08-09 12:21:39 -07:00
parent d2381bebaf
commit c1c8791335
No known key found for this signature in database
GPG Key ID: A5AD4A9AD42D69AB

View File

@ -198,9 +198,9 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '1555878318469091330',
'ext': 'mp4',
'title': '@TulsiGabbard-1555878318469091330',
'title': 'Tulsi Gabbard 🌺 - Puberty-blocking procedures promote[...]',
'description': 'Puberty-blocking procedures promoted by the Biden/Harris Admin are child abuse. The FDA has recently confirmed these hormones/drugs have extremely dangerous side effects, like brain swelling and vision loss. https://t.co/pcc70Uyt76',
'thumbnail': r're:^https?://.*\.jpg',
'description': """Puberty-blocking procedures promoted by the Biden/Harris Admin are child abuse. The FDA has recently confirmed these hormones/drugs have extremely dangerous side effects, like brain swelling and vision loss. https://t.co/pcc70Uyt76""",
'uploader': 'Tulsi Gabbard 🌺',
'uploader_id': 'TulsiGabbard',
'duration': 44.466,
@ -213,7 +213,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '643211948184596480',
'ext': 'mp4',
'title': '@freethenipple-643211948184596480',
'title': 'FREE THE NIPPLE - FTN supporters on Hollywood Blvd to[...]',
'thumbnail': r're:^https?://.*\.jpg',
'description': 'FTN supporters on Hollywood Blvd today! http://t.co/c7jHH749xJ',
'uploader': 'FREE THE NIPPLE',
@ -229,7 +229,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '657991469417025536',
'ext': 'mp4',
'title': '@giphz-657991469417025536',
'title': 'Gifs - "tu vai cai tu vai cai tu nao eh capaz disso[...]',
'description': 'Gifs on Twitter: "tu vai cai tu vai cai tu nao eh capaz disso tu vai cai https://t.co/tM46VHFlO5"',
'thumbnail': r're:^https?://.*\.png',
'uploader': 'Gifs',
@ -242,7 +242,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '665052190608723968',
'ext': 'mp4',
'title': '@starwars-665052190608723968',
'title': 'Star Wars | Andor Premieres Sept 21 on Disney+ - A new beginning is coming December [...]',
'description': 'A new beginning is coming December 18. Watch the official 60 second #TV spot for #StarWars: #TheForceAwakens. https://t.co/OkSqT2fjWJ',
'uploader_id': 'starwars',
'uploader': 'Star Wars | Andor Premieres Sept 21 on Disney+',
@ -254,7 +254,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '705235433198714880',
'ext': 'mp4',
'title': '@BTNBrentYarina-705235433198714880',
'title': 'Brent Yarina - Khalil Iverson\'s missed highlight dunk. And made highlight dunk[...]',
'description': "Khalil Iverson's missed highlight dunk. And made highlight dunk. In one highlight. https://t.co/OrxcJ28Bns",
'uploader_id': 'BTNBrentYarina',
'uploader': 'Brent Yarina',
@ -271,7 +271,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '700207533655363584',
'ext': 'mp4',
'title': '@jaydingeer-700207533655363584',
'title': 'jaydin donte geer - BEAT PROD: @suhmeduh https://t.co/[...]',
'description': 'BEAT PROD: @suhmeduh https://t.co/HBrQ4AfpvZ #Damndaniel https://t.co/byBooq2ejZ',
'thumbnail': r're:^https?://.*\.jpg',
'uploader': 'jaydin donte geer',
@ -298,7 +298,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '719944021058060289',
'ext': 'mp4',
'title': '@CaptainAmerica-719944021058060289',
'title': 'Captain America - @King0fNerd Are you sure you made t[...]',
'description': '@King0fNerd Are you sure you made the right choice? Find out in theaters. https://t.co/GpgYi9xMJI',
'uploader_id': 'CaptainAmerica',
'uploader': 'Captain America',
@ -338,7 +338,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '910031516746514432',
'ext': 'mp4',
'title': '@Prefet971-910031516746514432',
'title': 'Préfet de Guadeloupe - [Direct] #Maria Le centre se trouve[...]',
'thumbnail': r're:^https?://.*\.jpg',
'description': '[Direct] #Maria Le centre se trouve actuellement au sud de Basse-Terre. Restez confinés. Réfugiez-vous dans la pièce la + sûre. https://t.co/mwx01Rs4lo',
'uploader': 'Préfet de Guadeloupe',
@ -356,7 +356,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '1001551623938805763',
'ext': 'mp4',
'title': '@LisPower1-1001551623938805763',
'title': 'Lis Power - Holy shit, Shep is on a roll today.[...]',
'thumbnail': r're:^https?://.*\.jpg',
'description': 'md5:37b9f2ff31720cef23b2bd42ee8a0f09',
'uploader': 'Lis Power',
@ -373,7 +373,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '1087791357756956680',
'ext': 'mp4',
'title': '@Twitter-1087791357756956680',
'title': 'Twitter - A new https://t.co/fHiPXozBdO is co[...]',
'thumbnail': r're:^https?://.*\.jpg',
'description': 'md5:6dfd341a3310fb97d80d2bf7145df976',
'uploader': 'Twitter',
@ -399,7 +399,7 @@ class TwitterIE(TwitterBaseIE):
'info_dict': {
'id': '1349794411333394432',
'ext': 'mp4',
'title': '@BrooklynNets-1349794411333394432',
'title': 'Brooklyn Nets - WATCH: Sean Marks\' full media sessi[...]',
'thumbnail': r're:^https?://.*\.jpg',
'description': 'md5:71ead15ec44cee55071547d6447c6a3e',
'uploader': 'Brooklyn Nets',
@ -464,9 +464,11 @@ class TwitterIE(TwitterBaseIE):
timestamp = unified_timestamp(status.get('created_at'))
# Keep the file name short so it doesn't exceed filesystem limits
title = self._generic_title(url)
if uploader_id:
title = '@%s-%s' % (uploader_id, title)
title = description
if len(title) > 40:
title = title[:35] + "[...]"
if uploader:
title = '%s - %s' % (uploader, title)
tags = []
for hashtag in (try_get(status, lambda x: x['entities']['hashtags'], list) or []):