Changeset 16514


Ignore:
Timestamp:
Aug 9, 2016, 4:37:34 PM (3 years ago)
Author:
dferreira
Message:

Changes made to download on the server.

Location:
internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/aptoide_mature_app_detector/explicit_content_detector/API/Explicit_detector/Illustration2Vector/illustration2vec_master/analyse_image.py

    r16513 r16514  
    2323def analyse_explicit(illust2vec, image_dir):
    2424
    25         print image_dir
    2625
    2726        try:
  • internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/aptoide_mature_app_detector/explicit_content_detector/API/views.py

    r16513 r16514  
    3333                pass
    3434        path = image_path.split("/")[-1:][0]
    35         final_path = "/"+parent_dir+"/"+path[0]+"/"+path[1]+"/"+path[2]+"/"+path[3:]
     35        final_path = "/"+parent_dir+"/"+path[0]+"/"+path[1]+"/"+path[2]+"/"+path
    3636        return final_path
    3737
     
    6363        scr = []
    6464        scr_hd = []
    65 
     65        # Relative path to our images. To use on outer machine, uncomment the following code and comment the next line after that code.
    6666        if 'sshots' in page['media']:
    6767                for s in page['media']['sshots']:
     
    7171                        #       temp = s.split('http://',1)
    7272                        #scr.append(config['directories']['local_image_path_prefix']+temp[1])
    73                         print local_url(config['directories']['local_image_path_prefix'],s)
     73                        #print local_url(config['directories']['local_image_path_prefix'],s)
    7474                        scr.append(local_url(config['directories']['local_image_path_prefix'],s))
    7575
     
    8686
    8787        icon = page['apk']['icon']
    88         temp = icon.split('http://',1)
     88        #temp = icon.split('http://',1)
    8989
    90         icon = config['directories']['local_image_path_prefix']+temp[1]
     90        #icon = config['directories']['local_image_path_prefix']+temp[1]
     91        icon = local_url(config['directories']['local_image_path_prefix'], icon)
    9192
    9293        icon_hd = []
    9394        if 'icon_hd' in page['apk']:
    9495                icon_hd = page['apk']['icon_hd']
    95                 temp = icon_hd.split('http://',1)
     96                #temp = icon_hd.split('http://',1)
    9697
    97                 icon_hd = config['directories']['local_image_path_prefix']+temp[1]
     98                #icon_hd = config['directories']['local_image_path_prefix']+temp[1]
     99                icon_hd = local_url(config['directories']['local_image_path_prefix'],icon_hd)
    98100
    99101        icons = []
     
    123125        Model._time = now
    124126        exp = False
    125         #try:
     127        try:
    126128                # Fetching the JSON content
    127         webpage = urllib2.urlopen(url+str(app_id)+"/json")
    128         soup = BeautifulSoup(webpage, "lxml")
     129                webpage = urllib2.urlopen(url+str(app_id)+"/json")
     130                soup = BeautifulSoup(webpage, "lxml")
    129131                               
    130         text = soup.get_text()
    131         page = json.loads(text)
    132         if page['status']!='FAIL':
     132                text = soup.get_text()
     133                page = json.loads(text)
     134                if page['status']!='FAIL':
    133135
    134                 exp = get_data(page)
     136                        exp = get_data(page)
    135137
    136         else:
     138                else:
     139                        status = 'Failed'
     140                        print "App does not exist"
     141                        return redirect('error')
     142        except:
    137143                status = 'Failed'
    138                 print "App does not exist"
     144                print "Error during parsing"
    139145                return redirect('error')
    140         #except:
    141         #       status = 'Failed'
    142         #       print "Error during parsing"
    143         #       return redirect('error')
    144146
    145147        # If it's explicit content, redirects to true page. Otherwise, redirects to false page.
  • internals/2016/aptoideimagesdetector/trunk/aptoide_mature_app_detector/config.json

    r16508 r16514  
    33                "_Comments":"paths should always be relative to django project (where you run manage.py runserver)",
    44                "_Comments2":"url_images to be changed to local server of images",
    5                 "local_image_path_prefix": "http://",
     5                "local_image_path_prefix": "imgs",
    66                "ill2vec_ser": "API/Explicit_detector/Illustration2Vector/illustration2vec_master/illust2vec.pickle",
    77                "ill2vec_model": "API/Explicit_detector/Illustration2Vector/illustration2vec-master/illust2vec_tag_ver200.caffemodel",
Note: See TracChangeset for help on using the changeset viewer.