Comments (3)
I have the same problem.
Traceback (most recent call last):
File "./export.py", line 11, in <module>
archiver.archive_room(room_id)
File "/usr/local/lib/python3.6/dist-packages/webexteamsarchiver/webexteamsarchiver.py", line 165, in archive_room
self._gather_room_information(room_id, download_avatars)
File "/usr/local/lib/python3.6/dist-packages/webexteamsarchiver/webexteamsarchiver.py", line 302, in _gather_room_information
self._organize_by_threads(self.messages, download_avatars)
File "/usr/local/lib/python3.6/dist-packages/webexteamsarchiver/webexteamsarchiver.py", line 349, in _organize_by_threads
file_metadata = self.file_details(url)
File "/usr/local/lib/python3.6/dist-packages/webexteamsarchiver/webexteamsarchiver.py", line 106, in file_details
raise MalformedResponse(message)
webexteamssdk.exceptions.MalformedResponse: Failed to find filename='' in attachment; filename="" for url https://webexapis.com/v1/contents/Y2lzY29zcGFyazovL....................tNDExZjg2MTQ0Yzg5LzA
When looking at the headers for that file:
HTTP/2 200
date: Wed, 17 Mar 2021 01:31:44 GMT
content-type: text/plain
content-length: 115732
cache-control: no-cache, no-store
via: 1.1 linkerd
trackingid: ROUTER_60.......2803BA
server: Redacted
content-disposition: attachment; filename=""
vary: accept-encoding
strict-transport-security: max-age=63072000; includeSubDomains; preload
so there is really no filename... how can that be?.. and is there a workaround?
from webex-teams-archiver.
FYI, I have changed this if clause:
webex-teams-archiver/webexteamsarchiver/webexteamsarchiver.py
Lines 102 to 106 in 1106086
to this block:
if not filename_re:
newfilename = re.sub(r'^.+/([^/]+)$', r'\1', url)
message = (
f"Set filename to '{newfilename}' in {r.headers.get('Content-Disposition', '')} for url {url}"
)
logger.debug(message)
filename_re = re.search(r"filename=\"(.+?)\"", f"filename=\"{newfilename}\"", re.I)
#raise MalformedResponse(message)
That will set the filename to the last part of the URL.
Means: the URL of the attachment is maybe something like this:
https://webexapis.com/v1/contents/Y2lzY29zcGFyazovL3VzL0NPTlRFTlQvYTM1N2foobarasdf
And if then there is no original filename information in the content-disposition header like I describe in my posting above, then the file will be saved as "Y2lzY29zcGFyazovL3VzL0NPTlRFTlQvYTM1N2foobarasdf"
Works like a charm for me.
from webex-teams-archiver.
@pzystorm thanks! I've released v0.11.1 with your suggestion.
from webex-teams-archiver.
Related Issues (14)
- Add option to download avatars
- Change archive filename timestamp format and switch to UTC
- Need support for threading HOT 1
- Request time-out for a large room HOT 1
- Handle [Errno 36] File name too long
- Archiver needs to have its own CSS HOT 4
- ImportError: cannot import name 'soft_unicode' from 'markupsafe' HOT 1
- Inspect and clean attachment file names
- Handle scenarios where users have left Webex Teams
- Add timestamp to archive file name
- Handle when lastActivity is not present
- Handle messages that don't have personId/personEmail
- Prevent HTML injection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webex-teams-archiver.