This video url is already in the attachment section. I want to add this video to the actual result section in the description
start_idx = current_description.find("Actual Results") + len("Actual Results")
before_append = current_description[:start_idx].strip()
after_append = current_description[start_idx:].strip()
updated_description = (
f"{before_append}\n"
+ "\n".join([f"<h2>Video Preview</h2><a href='{url}' target='_blank'>{url}</a>" for url in file_urls])
+ f"\n{after_append}"
)
Can you give us a bit more details on what you want to achieve? Its not clear from your description.
Where are you using that code you've shared?
Do you want to copy the attachment name to the description?
copy the attachment?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.