Can lc.create_list_for() return the csv file name?
skill4net opened this issue · 3 comments
lc.create_list_for(url=channel_url)
will complete all jobs but return nothing.
Can make lc.create_list_for() return the csv file name, so we can use csv_file_name = lc.create_list_for(url=channel_url) for next processing? e.g. we can get video url from from the csv file then download the video.
Thank you.
Hmm so based on your suggestion I'm guessing this would be used to:
- open up the file
- parse the csv for the video url
- then do something with the url
Does that seem right? In this case I can return the file_name
as the result of lc.create_list_for(url=channel_url)
. This way, you can also choose to do anything with the txt
or md
file if you need in addition to csv
, since you can append the extension for whichever file you want to work with.
Does this sound okay, or are there some more modifications that would make it better?
Pushed a fix in the commit above ↑
With this change, you can do:
file_name = lc.create_list_for(url=channel_url)
csv_file_name = f'{file_name}.csv'
txt_file_name = f'{file_name}.txt'
md_file_name = f'{file_name}.md'
Does this address the problem, or is there anything else we should add?
@skill4net
Hiding this comment due to outdated information (already merged into master
).
Merged the corresponding PR (#6) for this issue since I didn't see any activity on this issue nor on #6.
Please reopen this issue if the problem still exists!
This change is now in the main
branch and will be available from running pip install -U yt-videos-list
following the next PyPI release, but if you want to run it before the release is formally pushed (might take a few days), run the following:
git clone https://github.com/slow-but-steady/yt_videos_list.git
cd yt_videos_list\python
pip install . # Windows
python # Windows
pip3 install . # MacOS/Linux
python3 # MacOS/Linux
from yt_videos_list import ListCreator
lc = ListCreator()
file_name = lc.create_list_for(url=channel_url)
csv_file_name = f'{file_name}.csv'
txt_file_name = f'{file_name}.txt'
md_file_name = f'{file_name}.md'