meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.99k stars 130 forks source link

Error when downloading videos with no downvotes #50

Closed theoutsider24 closed 3 years ago

theoutsider24 commented 3 years ago

Couldn't download this video (https://www.youtube.com/watch?v=O7AXkEzX2VM&ab_channel=LoLEsportsVODsandHighlights) with no downvotes (at time of writing)

Traceback:

Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/background_task/tasks.py", line 43, in bg_runner func(*args, **kwargs) File "/app/sync/tasks.py", line 335, in download_media write_text_file(media.nfopath, media.nfoxml) File "/app/sync/models.py", line 1081, in nfoxml votes.text = str(self.votes) File "/app/sync/models.py", line 981, in votes return upvotes + downvotes TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

theoutsider24 commented 3 years ago

TubeSync version 0.8 with youtube-dl version 2021.01.16 and FFmpeg version 4.3.1-static.

theoutsider24 commented 3 years ago

Possibly requires changing from downvotes = self.loaded_metadata.get(field, 0) to downvotes = self.loaded_metadata.get(field) || 0

theoutsider24 commented 3 years ago

Damn @meeb you beast!

meeb commented 3 years ago

Thanks for the report, fixed in :latest and will be bundled into the next release.