-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when getting a video from a friend. #18
Comments
I actually got a video from a friend, but I couldn't open it. Seems like it's broken.
|
You sent a video from a Mac with snapchat ? Did you receive it ? I will try to send a few test videos to the bot, then post results. |
@N07070 No, sorry I meant that I'm running on a Mac |
Could you try to run it on another system ( windows,linux,bsd ? ) |
@N07070 I recieved it, and saved it. I could try running it on linux within the next hour I believe. |
Could not reproduce with my OnePlus. Assuming it's fixed ? I will try with another phone. |
@N07070 Haven't tried those yet, just modified the |
@N07070 - yes, of course, why wouldn't you be able to? You could also pick a random person from your friends list to send it to. |
I was actually more geunily curious, but it is true that a random snap service would be pretty neat. A thing a bit like Fling. |
My bot will crash with the exact error same error if either myself (Nexus 4) or two of my friends (iPhone 5) send it any form of video. However, other people (I don't know the device or snapchat version) have successfully sent it a video. |
Seems to be an error with the determination of media type ( which is strange, cause it's supposed to be all .mp4 ) |
Up, I'm still getting the error. It seems to come from pysnap, so I would like to update pysnap to do that. Is it possible ? Could we update to using the last version of pysnap ? The snap sent is a video.
|
I can't look into this now, but it might be worth cloning the library, edit some code involved with retrieving the file type and then installing that library. |
PIL and ImageMagick installed? Only thing I can think of because I am not having this issue and I have both of these installed. |
I have both of those installed and still get the issue. |
I think that might be key. Snapchat for Android might be sending the data of the snap gzipped, unlike the iOS version which sends raw data. |
To the others who are encountering this issue: what phone are the snaps you're trying to process being sent from? |
@agermanidis do you think you could get an android phone for a few days to test ? I could provide a small, old, galaxy Y phone. |
I have an android phone and I could test, however for some reason I am On Tue, Mar 3, 2015 at 2:26 PM, N07070 [email protected] wrote:
|
It seems that it's an error with our IPs being banned. |
That doesn't make sense though. I have the exact same IP address on my I looked up 400 Client Error and it has something to do with sending the On Tue, Mar 3, 2015 at 2:29 PM, N07070 [email protected] wrote:
|
Fixed. Okay, but the issue is still not fixed with videos 😄 |
If you have a look at the open issue about a 400 Bad Request error you can follow the updates on the situation, basically Snapchat have most likely tried pushing users to |
Awesome thank you! Can't wait until the videos are working. Thanks for the On Wed, Mar 4, 2015 at 4:36 PM, N07070 [email protected] wrote:
|
The videos should be working - right now I've got a bot running on a server that can handle videos. If you provide me with more information, I can try and solve the issue if I have time tomorrow. |
All I know is that when I (Android (lollipop) nexus 4) or my friends on On Wed, Mar 4, 2015 at 4:52 PM, Robert [email protected] wrote:
|
It seems to be very random, sometimes it's okay, sometimes no...
|
I am getting the same issue, I tried saving the file and the images work but the videos come out as 0 bytes, it could be the zip issue, but it looks like pysnap takes care of that? |
I have the same issue happening with me. I'm able to send videos without text on the screen. However, if there is no text it sends just fine. Using SnapPrefs on android, I do believe the video and text are saved as separate files. I.e. the videos are saved as MP4s, and the text is saved as a jpg. Could this perchance be the problem? |
@feedthedogs I had the same issue with saving files, I found another simpler solution (only three lines). Python has a handy library called |
E: I think the problem comes from snaps with text that are both jpg and mp4. |
@N07070 that being said with the snaps being sent as both jpeg and mp4, any ideas how these are sent over Snapchat? As previously commented, are they gzipped then sent to be extracted on the client end? Would it be possible to redirect the entire snap somehow without the api touching it and separating the text jpg and the mp4? I haven't poked around much in the library, and plan to look more in the coming weeks as this is a very interesting library to work with. |
I really don't have the competence to help out with this, sorry man... |
I'm also having an issue saving any videos at all (they come up as 0 bytes). These have been sent from a variety of phones. Generally, I can manipulate the snaps even if they are videos. However, there was one error with a Galaxy S3 that the bot was crashing when it tried to send it a video. (This doesn't happen any more.) Additionally, how would you suggest updating the library so it is up to date with the master branch here? Would a |
So, for me, it's just when there is texte added. Le 10 mars 2015 12:11:10 GMT+01:00, Ishaan Taylor [email protected] a écrit :
Envoyé de mon appareil Android avec K-9 Mail. Veuillez excuser ma brièveté. |
@agermanidis has there been any progress to this? Any idea if another pysnap library has figured out this issue? I'm still getting it on my end. |
@PhlexPlexico, my library can 'save' snaps. When downloading a snap a temporary file is made, my |
If you save snaps, you juste repost it using the Snap.from_file() method ? |
What do you mean? |
I think he means:
|
Yes, indeed. |
I believe the error exists in pysnap, and not in SnapchatBot. To be exact, it is this function in init.py def is_video(data):
return len(data) > 1 and data[0:2] == b'\x00\x00' My guess is that the byte matching fails. When I print the bytes of two random video tempfiles, they start like this: Wikipedia says the signature Renaming the mp4 tempfile to a zip works, and I can open it and view the contents, like the text overlay. |
Can you send me the file (see email in profile) so I can test some code against it? Phone is having camera issues so I can't generate a test video snap with a caption right now. |
I will do that. Pysnap needs to be changed several places; first it needs to detect zip as video, then it needs to set the zipped-value to 1 in the json-request when the file is a zip. Detecting it as a video is trivial: def is_video(data):
signature = data[0:2]
return len(data) > 1 and (signature == b'\x00\x00' or signature == b'\x50\x4B') This is under the assumption that the zip will never be an image. |
Will it be updated soon ? How could I help you ? |
The file uploaded from android is indeed a .zip. Also, it has type 2 when the video is muted, and type 1 when it is normal. So a videosnap with text is a zip with a type that matches its video. |
I'm working on supporting captions generally, both in incoming snaps (with The "zipped" field doesn't really matter, it's easy to detect whether data On Sun, Mar 15, 2015 at 8:52 PM, Kristian Rekstad [email protected]
Anastasis Germanidis |
I have a bot that I have been coding on for a while to do a bunch of different things. I can sent it commands via the text on the image and it will do stuff based on the commands received. I'm using the tesseract OCR library to parse the text. |
I think that this crash got something to do with this. After logging in from phone and watching video-snap, everything works. Im using CentOS 7, installed today. |
@bl3ndom This is a different issue. Try running it with sudo. |
@agermanidis my comment regarding the zipped field was for uploading to snapchat's servers. Uploading requires some changes to pysnap. I believe this is sufficient, but I have not tested it yet. |
Is this fixed if I use your pysnap version then ? Because when I save the snap, being a video, I get a 0 bit file... Then, ffmpeg gives me the following error : |
@N07070 My pysnap is not enough. You also need to implement the change in SnapchatBot. ffmpeg needs the mp4 inside the zip, so you must make sure it is extracted. I believe this have been implemented now by Agetmanidis, but I may be wrong. |
I'm trying to fix it. Could use a little help 😉
Edit: Works with the iPhone 6, but not with Android Phones ( OnePlus One )
Traceback (most recent call last): File "./storyfbbot-dev.py", line 40, in <module> bot.listen() File "/home/n07070/Code/SnapchatBot/snapchat_bots/bot.py", line 54, in listen self.on_snap(snap.sender, snap) File "./storyfbbot-dev.py", line 26, in on_snap self.post_story(snap) File "/home/n07070/Code/SnapchatBot/snapchat_bots/bot.py", line 101, in post_story snap.upload(self) File "/home/n07070/Code/SnapchatBot/snapchat_bots/snap.py", line 40, in upload self.media_id = bot.client.upload(self.file.name) File "build/bdist.linux-i686/egg/pysnap/__init__.py", line 353, in upload ValueError: Could not determine media type for given data
The text was updated successfully, but these errors were encountered: