mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-03 19:57:06 -05:00 
			
		
		
		
	[bandcamp] Modernize
This commit is contained in:
		@@ -10,6 +10,8 @@ from ..compat import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
from ..utils import (
 | 
					from ..utils import (
 | 
				
			||||||
    ExtractorError,
 | 
					    ExtractorError,
 | 
				
			||||||
 | 
					    float_or_none,
 | 
				
			||||||
 | 
					    int_or_none,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -56,7 +58,7 @@ class BandcampIE(InfoExtractor):
 | 
				
			|||||||
                        'ext': ext,
 | 
					                        'ext': ext,
 | 
				
			||||||
                        'vcodec': 'none',
 | 
					                        'vcodec': 'none',
 | 
				
			||||||
                        'acodec': ext,
 | 
					                        'acodec': ext,
 | 
				
			||||||
                        'abr': int(abr_str),
 | 
					                        'abr': int_or_none(abr_str),
 | 
				
			||||||
                    })
 | 
					                    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                self._sort_formats(formats)
 | 
					                self._sort_formats(formats)
 | 
				
			||||||
@@ -65,7 +67,7 @@ class BandcampIE(InfoExtractor):
 | 
				
			|||||||
                    'id': compat_str(data['id']),
 | 
					                    'id': compat_str(data['id']),
 | 
				
			||||||
                    'title': data['title'],
 | 
					                    'title': data['title'],
 | 
				
			||||||
                    'formats': formats,
 | 
					                    'formats': formats,
 | 
				
			||||||
                    'duration': float(data['duration']),
 | 
					                    'duration': float_or_none(data.get('duration')),
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                raise ExtractorError('No free songs found')
 | 
					                raise ExtractorError('No free songs found')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user