Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading files from Livelink URL

Status
Not open for further replies.

pratikr

Programmer
Sep 14, 2024
2
I have an excel spreadsheet with one of the columns containing Livelink URLs in the following format - http://livelink.organisation-name.net/livelink.exe/open/{file_id} where file_id is the placeholder for actual file identifiers. I have to automate the task of downloading the files and placing them in appropriate folder based on certain tag (not relevant). I am trying to write a Python script to automate and using requests.get method but having trouble with authentication. I have two questions -
  1. What authentication patterns can be used to achieve this objective?
  2. Can I pass the above URL in requests.get method to retrieve the underlying PDF file?
 
Last edited:
  1. Using OTDS or OTCS authentication endpoint get a token.A valid tokeen is needed for any operation.
  2. REST API has a method to fetch the content.You will have to create a file object to receive the content.
  3. Since your operation involves multiple downloads you should create a chained mechanism for example when you download your first file in the headers livelink will return you a token use this for next and next so that they do not time out.
 
  1. Using OTDS or OTCS authentication endpoint get a token.A valid tokeen is needed for any operation.
  2. REST API has a method to fetch the content.You will have to create a file object to receive the content.
  3. Since your operation involves multiple downloads you should create a chained mechanism for example when you download your first file in the headers livelink will return you a token use this for next and next so that they do not time out.
Correct me if I am wrong - In order to fetch the file from the appropriate API method will I have to extract the node id from the URL mentioned above?
Also, is there any way I can use urllib.request.urlretrieve to directly use the given URL?
 
Yes CS after authentication needs to be told the VERB with which a NODEID has to be accessed as in Download,Version etc...
REST API is no different from an actual CS URL
- http://livelink.organisation-name.net/livelink.exe/open/{file_id} when you issue the call after authentication the livelink request handler will see the nodeid and do what Open is coded to do for that NodeID

I don't fully know what this is urllib.request.urlretrieve what is the context or language this is about looks like it is a python library.Several programmers in OT KB has put python snippets to get livelink content.I have not done python so I cant comment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top