Download all available (and new) files
Asked Answered
J

1

-1

I'm using NSURLSessionDownloadTask to download some .mov files from a web and storing them in my app.

Now what I'd like to achieve is to

  • download ALL files of certain type (in this case .mov) available on the page, without having to specify every file URL

  • download files ONLY if they are not already stored in my app.

Is there any way to achieve this?

Joaniejoann answered 15/3, 2016 at 17:25 Comment(0)
P
1
  1. You would have to scrape that html page to get all the urls (.mov) you are looking for. Either you can use NSXMLParser if you want to write your own or you can google some library.

  2. When you download a file, persist some metadata (eg. name or some unique identifier) either in SQLite or CoreData, so that you can check if the file has already been downloaded.

Preparation answered 15/3, 2016 at 17:33 Comment(2)
well yes, this is the idea. I was asking if someone could help achieving itJoaniejoann
Nice tutorial to parse html. I would start with this. Then to persist data I would Read this. Let me know if you need some other help.Preparation

© 2022 - 2024 — McMap. All rights reserved.