list index out of range
Hi @podborski ,
I am trying your script. First of all, I am not able to get csv
:
(...): pip3 install --user --upgrade python-gitlab
Collecting python-gitlab
Using cached https://files.pythonhosted.org/packages/b0/5f/2ecfd792eced1c43576bfd49dd96ff872775b985d2759bb8e68cf1f26365/python_gitlab-2.5.0-py3-none-any.whl
Collecting requests>=2.22.0 (from python-gitlab)
Using cached https://files.pythonhosted.org/packages/29/c1/24814557f1d22c56d50280771a17307e6bf87b70727d975fd6b2ce6b014a/requests-2.25.1-py2.py3-none-any.whl
Requirement already satisfied, skipping upgrade: urllib3<1.27,>=1.21.1 in /sysmnt/cadappl_linuxi386_borealis/python3/3.7/lib/python3.7/site-packages (from requests>=2.22.0->python-gitlab) (1.24.1)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /sysmnt/cadappl_linuxi386_borealis/python3/3.7/lib/python3.7/site-packages (from requests>=2.22.0->python-gitlab) (2019.9.11)
Requirement already satisfied, skipping upgrade: chardet<5,>=3.0.2 in /sysmnt/cadappl_linuxi386_borealis/python3/3.7/lib/python3.7/site-packages (from requests>=2.22.0->python-gitlab) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in /sysmnt/cadappl_linuxi386_borealis/python3/3.7/lib/python3.7/site-packages (from requests>=2.22.0->python-gitlab) (2.8)
Installing collected packages: requests, python-gitlab
Successfully installed python-gitlab-2.5.0 requests-2.25.1
(...): pip3 install --user csv
Collecting csv
ERROR: Could not find a version that satisfies the requirement csv (from versions: none)
ERROR: No matching distribution found for csv
Ignoring that, I have set the three variables and I have changed the project ID to my Sandbox project.
This is what I get:
(...): python3 ./mpegAutomation.py
./mpegAutomation.py:48: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
The code that caused this warning is on line 48 of the file ./mpegAutomation.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor.
soup = BeautifulSoup(alltext)
get metadata for 55686
get metadata for 56083
------
['m55686', None]
------
Traceback (most recent call last):
File "./mpegAutomation.py", line 145, in <module>
title = line[12] + ' ' + line[0]
IndexError: list index out of range
Compared to your code, I have added three print's:
# TODO: move it to its own method
n = 0
for line in entries:
print("------")
print(line)
print("------")
title = line[12] + ' ' + line[0]