Question: Perhaps we have an array of arrays such as this:

```
["a", "11.36"]
["b", "12.13"]
["c", "11.00"]

```

Is there a simple function to be able to sort them based on the 2nd index?

Answer: 
This is how I changed my code so it now downloads all of the pdfs and skips the one (or more) that may be correupted. I also had to add the `self` argument to the function. 

```
from PyPDF2 import PdfFileMerger
import requests
import sys

urls = links 

def download_pdfs(self):
    merger = PdfFileMerger()
    for url in urls:
        try:
            response = requests.get(url)
            title = url.split("/")[-1]
            with open(title, 'wb') as f:
                f.write(response.content)
        except PdfReadError:
            print(title) 
            sys.exit()
    merger.append(title)

    merger.write("allminues.pdf")
    merger.close()

```
The end of file marker '%%EOF' is meant to be the very last line. It is a kind of marker where the pdf parser knows, that the PDF document ends here.

My solution is to force this marker to stay at the end:

```
def reset_eof(self, pdf_file):
    with open(pdf_file, 'rb') as p:
        txt = (p.readlines())
    for i, x in enumerate(txt[::-1]):
        if b'%%EOF' in x:
            actual_line = len(txt)-i-1
            break
    txtx = txt[:actual_line] + [b'%%EOF']
    with open(pdf_file, 'wb') as f:
        f.writelines(txtx)
    return PyPDF4.PdfFileReader(pdf_file)

```