论文思路

论文思路

参考磁力猫
搜索引擎or大数据?
电影bt资源搜索引擎
三个页面:
搜索页面
搜索结果页面

搜索的结果和和搜索的内容一样的标红
分页问题-没解决

详细资料页面

电影标题
海报
影片简介
导演-演员之类的
图片
截图
下载链接or播放链接

播放页面

播放器:http://www.ckplayer.com 使用这个
电影名
正在播放的信息
有多少级的列表
自动播放
上一级下一集的按钮

数据来源:

  1. 搬运工:http://www.banyungong.org/
  2. 爱拷:http://ikkao.com
  3. BT之家:http://www.btbtt77.com/
  4. 磁力猫:http://www.cilimao.me/
  5. 极速云:http://www.caijizy.com ——已采集

爬虫实时爬取资源or把资源存入数据库?
1.爬虫实时爬取资源:

通过提交POST请求,得到数据页面,解析匹配得到数据,返回自己得主页

2.把资源存入数据库:

先把资源通过爬虫爬取放入数据库,通过前端用户请求返回页面结果

前端:
Bootstrap
后端:
python-django
django查询数据需要模糊查询数据

运行
linux
python

    后台运行
    在项目目录下运行:nohup python3 manage.py runserver 0.0.0.0:80 >/dev/null 2>&1 &
def search(request):
    searchtype = request.POST.get("searchtype")
    keyword = request.POST.get("keyword")
    if searchtype == "all":
        #多个字段模糊查询, 括号中的下划线是双下划线,双下划线前是字段名,双下划线后可以是icontains或contains,区别是是否大小写敏感,竖线是或的意思
        sciencenews = models.Sciencenews.objects.filter(Q(title__icontains=keyword)\
        |Q(content__icontains=keyword)|Q(author__icontains=keyword))
    elif searchtype == "author":
        #单个字段模糊查询
        sciencenews = models.Sciencenews.objects.filter(author__icontains=keyword)
    elif searchtype == "title":
        sciencenews = models.Sciencenews.objects.filter(title__icontains=keyword)
    elif searchtype == "content":
        sciencenews = models.Sciencenews.objects.filter(content__icontains=keyword)
    else:
        #使用点连接的filter链表示and
        sciencenews = models.Sciencenews.objects.filter(author__icontains=keyword).\
            filter(title__icontains=keyword).filter(content__icontains=keyword)

    return render(request,"show/index.html",{"param":sciencenews,"searchtype":searchtype,"keyword":keyword})

参考:https://blog.csdn.net/liuweiyuxiang/article/details/71104613

猜你喜欢

转载自blog.csdn.net/qq_18545711/article/details/81626220