jeffreydwalter / arlo

Python module for interacting with Netgear's Arlo camera system.
Apache License 2.0
520 stars 123 forks source link

403 Client Error: Forbidden for url #148

Closed hjedmon closed 4 years ago

hjedmon commented 4 years ago

Please answer these questions before submitting your issue. Thanks!

What version of Python are you using (python -V)?

Python 2.7.16

What operating system and processor architecture are you using (python -c 'import platform; print(platform.uname());')?

('Linux', 'edmon-linux', '5.5.10', '#1 SMP Thu Mar 19 00:56:26 PDT 2020', 'x86_\ 64', '')

Debian buster

Which Python packages do you have installed (run the pip freeze or pip3 freeze command and paste output)?

apt-xapian-index==0.49                                                          
arlo==1.2.33                                                                    
asn1crypto==0.24.0                                                              
attrs==18.2.0                                                                   
Automat==0.6.0                                                                  
Axiom==0.7.5                                                                    
certifi==2019.11.28                                                             
cffi==1.12.2                                                                    
characteristic==14.3.0                                                          
chardet==3.0.4                                                                  
configobj==5.0.6                                                                
configparser==3.5.0b2                                                           
constantly==15.1.0                                                              
cryptography==2.6.1                                                             
dblatex==0.3.10                                                                 
defer==1.0.6                                                                    
defusedxml==0.5.0                                                               
dnspython==1.16.0                                                               
docutils==0.14                                                                  
entrypoints==0.3                                                                
enum34==1.1.6                                                                   
Epsilon==0.7.1                                                                  
feedparser==5.2.1                                                               
gpg==1.12.0                                                                     
html5lib==1.0.1                                                                 
httplib2==0.11.3                                                                
hyperlink==17.3.1                                                               
idna==2.6                                                                       
incremental==16.10.1
ipaddress==1.0.17                                                               
isodate==0.6.0                                                                  
keyring==17.1.1                                                                 
keyrings.alt==3.1.1                                                             
Louie==1.1                                                                      
lxml==4.3.2                                                                     
Mako==1.0.7                                                                     
MarkupSafe==1.1.0                                                               
mechanize==0.2.5                                                                
monotonic==1.5                                                                  
Nevow==0.14.2                                                                   
nose==1.3.7                                                                     
numpy==1.16.2                                                                   
PAM==0.4.2                                                                      
pexpect==4.6.0                                                                  
Pillow==5.4.1                                                                   
ply==3.11                                                                       
pyasn1==0.4.2                                                                   
pyasn1-modules==0.2.1                                                           
pycairo==1.16.2                                                                 
pycparser==2.19                                                                 
pycrypto==2.6.1                                                                 
pycups==1.9.73                                                                  
pycurl==7.43.0.2                                                                
Pygments==2.3.1                                                                 
PyGObject==3.30.4                                                               
pyinotify==0.9.6                                                                
PyOpenGL==3.1.0                                                                 
pyOpenSSL==19.0.0                                                               
pyparsing==2.2.0                                                                
pyserial==3.4                                                                   
PySimpleSOAP==1.16.2                                                            
pysmbc==1.0.15.6                                                                
PySocks==1.7.1                                                                  
pysqlite==2.7.0                                                                 
python-apt==1.8.4.1                                                             
python-debian==0.1.35                                                           
python-debianbts==2.8.2                                                         
pyxdg==0.25                                                                     
rdflib==4.2.2                                                                   
reportlab==3.5.13                                                               
requests==2.23.0                                                                
roman==2.0.0                                                                    
scour==0.37                                                                     
SecretStorage==2.3.1
service-identity==16.0.0                                                        
six==1.12.0                                                                     
SOAPpy==0.12.22                                                                 
SPARQLWrapper==1.8.2                                                            
sseclient==0.0.22                                                               
tagpy==2013.1                                                                   
Twisted==18.9.0                                                                 
urllib3==1.25.8                                                                 
uTidylib==0.5                                                                   
vboxapi==1.0                                                                    
webencodings==0.5.1                                                             
wstools==0.4.3                                                                  
zope.interface==4.3.2                                                                                                                                                         

Which version of ffmpeg are you using (ffmpeg -version)?

ffmpeg version 4.1.5 Copyright (c) 2000-2020 the FFmpeg developers              
built with gcc 8 (Debian 8.3.0-6)                                               
configuration: --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-\
libopencv --disable-outdev=sdl2 --disable-podpages --disable-sndio --disable-st\
ripping --enable-libaom --enable-avfilter --enable-avresample --enable-gcrypt -\
-disable-gnutls --enable-openssl --enable-gpl --enable-libass --enable-libblura\
y --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enabl\
e-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --\
enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-lib\
mp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh\
264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse\
 --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr -\
-enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab -\
-enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --en\
able-libzimg --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opencl\
 --enable-opengl --enable-postproc --enable-pthreads --enable-shared --enable-v\
ersion3 --enable-libwebp --incdir=/usr/include/x86_64-linux-gnu --libdir=/usr/l\
ib/x86_64-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable\
-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-\
vaapi --enable-libmfx --enable-libvmaf --disable-altivec --shlibdir=/usr/lib/x8\
6_64-linux-gnu                                                                  
libavutil      56. 22.100 / 56. 22.100                                          
libavcodec     58. 35.100 / 58. 35.100                                          
libavformat    58. 20.100 / 58. 20.100                                          
libavdevice    58.  5.100 / 58.  5.100                                          
libavfilter     7. 40.101 /  7. 40.101                                          
libavresample   4.  0.  0 /  4.  0.  0                                          
libswscale      5.  3.100 /  5.  3.100                                          
libswresample   3.  3.100 /  3.  3.100                                          
libpostproc    55.  3.100 / 55.  3.100                                          

Which Arlo hardware do you have (camera types - [Arlo, Pro, Q, etc.], basestation model, etc.)?

Arlo Pro

What did you do?

Ran this program:

from arlo import Arlo import logging

USERNAME = PASSWORD =

logging.basicConfig(filename='example2.log',level=logging.DEBUG) try:

Instantiating the Arlo object automatically calls Login(), which returns \

an oAuth token that gets cached.

Subsequent successful calls to login will update the oAuth token.

arlo = Arlo(USERNAME, PASSWORD)
# At this point you're logged into Arlo.
    print "in"
# Get the list of devices and filter on device type to only get the basesta\

tion.

This will return an array which includes all of the basestation's associa\

ted metadata. basestations = arlo.GetDevices('basestation')

    # Get the list of devices and filter on device type to only get the cam\

era.

This will return an array which includes all of the camera's associat\

ed metadata.
cameras = arlo.GetDevices('camera')

Tells the Arlo basestation to trigger a snapshot on the given camera.

    # This snapshot is not instantaneous, so this method waits for the resp\

onse and returns the url

for the snapshot, which is stored on the Amazon AWS servers.

    print "ready"                                                           
    snapshot_url = arlo.TriggerFullFrameSnapshot(basestations[0], cameras[0\

])
print "url"
print snapshot_url

    # This method requests the snapshot for the given url and writes the im\

age data to the location specified.

In this case, to the current directory as a file named "snapshot.jpg"

    # Note: Snapshots are in .jpg format.                                   
    arlo.DownloadSnapshot(snapshot_url, 'snapshot.jpg')

except Exception as e: print(e)

What did you expect to see?

Production of a snapshot and output from my print statements

What did you see instead?

403 Client Error: Forbidden for url: https://my.arlo.com/hmsweb/login/v2

Here is the debug output:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): my.arlo.com:443
DEBUG:urllib3.connectionpool:https://my.arlo.com:443 "POST /hmsweb/login/v2 HTT\
P/1.1" 403 None

I do not have 2FA enabled.

This worked for me last fall, and I was using Debian buster at that time.

Does this issue reproduce with the latest release?

Yes.

jeffreydwalter commented 4 years ago

Arlo has made changes tot their authentication. It no longer uses the v2 API. They are moving to an oAuth provider. See this issue: https://github.com/jeffreydwalter/arlo/issues/146