Changeset 16504


Ignore:
Timestamp:
Aug 9, 2016, 9:38:53 AM (3 years ago)
Author:
dferreira
Message:

Views changed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/aptoide_mature_app_detector/explicit_content_detector/API/views.py

    r16502 r16504  
    109109        Model._time = now
    110110        exp = False
    111         #try:
     111        try:
    112112                # Fetching the JSON content
    113         webpage = urllib2.urlopen(url+str(app_id)+"/json")
    114         soup = BeautifulSoup(webpage, "lxml")
     113                webpage = urllib2.urlopen(url+str(app_id)+"/json")
     114                soup = BeautifulSoup(webpage, "lxml")
    115115                               
    116         text = soup.get_text()
    117         page = json.loads(text)
    118         if page['status']!='FAIL':
     116                text = soup.get_text()
     117                page = json.loads(text)
     118                if page['status']!='FAIL':
    119119
    120                 exp = get_data(page)
     120                        exp = get_data(page)
    121121
    122         else:
     122                else:
     123                        status = 'Failed'
     124                        print "App does not exist"
     125                        return redirect('error')
     126        except:
    123127                status = 'Failed'
    124                 print "App does not exist"
     128                print "Error during parsing"
    125129                return redirect('error')
    126         #except:
    127         #       status = 'Failed'
    128         #       print "Error during parsing"
    129         #       return redirect('error')
    130130
    131131        # If it's explicit content, redirects to true page. Otherwise, redirects to false page.
Note: See TracChangeset for help on using the changeset viewer.