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

[fix]: AttributeError: can't set attribute #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import re
import threading
import pathlib

LOGGER = logging.getLogger(__name__)

Expand All @@ -19,7 +20,7 @@ def debug(self, msg):
# Hack to fix changing changing extension
match = re.search(r'.ffmpeg..Merging formats into..(.*?).$', msg)
if match and not self.obj.is_playlist:
self.obj.name = match.group(1)
self.obj.set_name(match.group(1))

@staticmethod
def warning(msg):
Expand Down Expand Up @@ -66,6 +67,10 @@ def download_speed(self):
def gid(self):
with self.__resource_lock:
return self.__gid

def set_name(self, name):
with self.__resource_lock:
self.__name = pathlib.PurePath(name).name

def __onDownloadProgress(self, d):
if self.is_cancelled:
Expand Down