Skip to content

Commit 11d1f4d

Browse files
committed
fixed output path bug (#2)
1 parent a02c572 commit 11d1f4d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

unimi_dl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# along with unimi-dl. If not, see <https://www.gnu.org/licenses/>.
1717

1818

19-
__version__ = "0.2.0"
19+
__version__ = "0.2.1"
2020
__license__ = "GPL v.3"
2121

2222
import unimi_dl.platform

unimi_dl/cmd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ def get_downloaded(downloaded_path: str, platform: str) -> tuple[dict[str, list[
160160
return downloaded_list, downloaded_file
161161

162162

163-
def download(output_path: str, manifest_list: list[tuple[str, str]], downloaded_list: dict, downloaded_file: TextIOWrapper, platform: str):
163+
def download(output_basepath: str, manifest_list: list[tuple[str, str]], downloaded_list: dict, downloaded_file: TextIOWrapper, platform: str):
164164
main_logger = logging.getLogger(__name__)
165-
if not os.access(output_path, os.W_OK):
166-
main_logger.error(f"can't write to directory {output_path}")
165+
if not os.access(output_basepath, os.W_OK):
166+
main_logger.error(f"can't write to directory {output_basepath}")
167167
exit(1)
168168
else:
169169
ydl_opts = {
@@ -174,7 +174,7 @@ def download(output_path: str, manifest_list: list[tuple[str, str]], downloaded_
174174
}
175175
for (filename, manifest) in manifest_list:
176176
if manifest not in downloaded_list[platform]:
177-
output_path = os.path.join(output_path, filename)
177+
output_path = os.path.join(output_basepath, filename)
178178
ydl_opts["outtmpl"] = output_path + ".%(ext)s"
179179
main_logger.info(f"Downloading {filename}")
180180
with youtube_dl.YoutubeDL(ydl_opts) as ydl:

0 commit comments

Comments
 (0)