Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
KoolShow committed Jan 2, 2024
2 parents 8d42409 + da3b781 commit 10a547d
Show file tree
Hide file tree
Showing 65 changed files with 1,315 additions and 370 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,27 @@
</div>
<p>使用Flutter开发的BiliBili第三方客户端</p>

<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/510shots_so.png" width="32%" alt="home" />
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/174shots_so.png" width="32%" alt="home" />
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/850shots_so.png" width="32%" alt="home" />
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/510shots_so.png" width="32%" alt="home" />
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/174shots_so.png" width="32%" alt="home" />
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/850shots_so.png" width="32%" alt="home" />
<br/>
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/main_screen.png" width="96%" alt="home" />
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/main_screen.png" width="96%" alt="home" />
<br/>
</div>

## 开发环境
Xcode 13.4 不支持**auto_orientation**,请注释相关代码

```bash
[✓] Flutter (Channel stable, 3.10.6, on macOS 12.1 21C52 darwin-arm64, locale
[✓] Flutter (Channel stable, 3.16.4, on macOS 14.1.2 23B92 darwin-arm64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.77.3)
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.85.1)
[✓] Connected device (3 available)
[✓] Network resources

```

Expand All @@ -42,6 +44,7 @@ Xcode 13.4 不支持**auto_orientation**,请注释相关代码
## 技术交流

Telegram: https://t.me/+lm_oOVmF0RJiODk1
QQ频道: https://pd.qq.com/s/365esodk3


<br/>
Expand Down Expand Up @@ -87,7 +90,7 @@ Telegram: https://t.me/+lm_oOVmF0RJiODk1
- [x] 画质选择(高清画质未解锁)
- [x] 音质选择(视视频而定)
- [x] 解码格式选择(视视频而定)
- [ ] 弹幕
- [x] 弹幕
- [ ] 字幕
- [x] 记忆播放
- [x] 视频比例:高度/宽度适应、填充、包含等
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
22 changes: 22 additions & 0 deletions change_log/1.0.15.0101.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## 1.0.15

元旦快乐~ 🎉

### 功能
+ 转发动态评论展示
+ 推荐、最热、收藏视频增肌日期显示

### 修复
+ 全屏播放相关问题
+ 评论区@用户展示问题
+ 登录状态闪退问题
+ pip意外触发问题
+ 动态页tab切换样式问题

### 优化
+ 首页默认使用web端推荐
+ 取消iOS路由切换效果
+ 视频分享中添加Up主

更多更新日志可在Github上查看
问题反馈、功能建议请查看「关于」页面。
9 changes: 9 additions & 0 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PiliPala is a third-party Bilibili client developed in Flutter.

Top Features:

* List of recommended videos
* List of hottest videos
* Popular live streams
* List of bangumis
* Block videos from blacklisted users
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fastlane/metadata/android/en-US/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A third-party Bilibili client developed in Flutter
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/title.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PiliPala
21 changes: 21 additions & 0 deletions fastlane/metadata/android/zh-CN/changelogs/2001.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
修复

* 全屏弹幕消失
* iOS 全屏/退出全屏视频暂停
* 个人主页关注状态
* 视频合集向下滑动UI问题
* 媒体库滑动底栏不隐藏
* 个人主页动态加载问题 * 2
* 未登录状态访问个人主页异常
* 视频搜索标题特殊字符转义
* iOS 闪退
* 消息页面夜间模式异常
* 消息页面含有撤回消息时异常
* 弹幕速度

优化

* 全屏播放方案优化
* 弹幕加载逻辑优化
* 点赞、投币逻辑优化
* 进度条及播放时间渲染优化
9 changes: 9 additions & 0 deletions fastlane/metadata/android/zh-CN/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PiliPala 是使用 Flutter 开发的 BiliBili 第三方客户端。

主要功能:

* 推荐视频列表 (app 端)
* 最热视频列表
* 热门直播
* 番剧列表
* 屏蔽黑名单内用户视频
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fastlane/metadata/android/zh-CN/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fastlane/metadata/android/zh-CN/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
使用 Flutter 开发的 BiliBili 第三方客户端
1 change: 1 addition & 0 deletions fastlane/metadata/android/zh-CN/title.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PiliPala
37 changes: 19 additions & 18 deletions lib/http/api.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import 'constants.dart';

class Api {
// 推荐视频
static const String recommendListApp =
'https://app.bilibili.com/x/v2/feed/index';
static const String recommendList = '/x/web-interface/index/top/feed/rcmd';
'${HttpString.appBaseUrl}/x/v2/feed/index';
static const String recommendListWeb = '/x/web-interface/index/top/feed/rcmd';

// 热门视频
static const String hotList = '/x/web-interface/popular';

// 视频流
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
static const String videoUrl = '/x/player/playurl';
static const String videoUrl = '/x/player/wbi/playurl';

// 视频详情
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
Expand Down Expand Up @@ -152,7 +154,7 @@ class Api {

// 动态点赞
static const String likeDynamic =
'https://api.vc.bilibili.com/dynamic_like/v1/dynamic_like/thumb';
'${HttpString.tUrl}/dynamic_like/v1/dynamic_like/thumb';

// 获取稍后再看
static const String seeYouLater = '/x/v2/history/toview';
Expand Down Expand Up @@ -220,13 +222,13 @@ class Api {
// 直播
// ?page=1&page_size=30&platform=web
static const String liveList =
'https://api.live.bilibili.com/xlive/web-interface/v1/second/getUserRecommend';
'${HttpString.liveBaseUrl}/xlive/web-interface/v1/second/getUserRecommend';

// 直播间详情
// cid roomId
// qn 80:流畅,150:高清,400:蓝光,10000:原画,20000:4K, 30000:杜比
static const String liveRoomInfo =
'https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo';
'${HttpString.liveBaseUrl}/xlive/web-room/v2/index/getRoomPlayInfo';

// 用户信息 需要Wbi签名
// https://api.bilibili.com/x/space/wbi/acc/info?mid=503427686&token=&platform=web&web_location=1550101&w_rid=d709892496ce93e3d94d6d37c95bde91&wts=1689301482
Expand Down Expand Up @@ -338,13 +340,13 @@ class Api {
/// wts=1697305010
static const String sessionList =
'https://api.vc.bilibili.com/session_svr/v1/session_svr/get_sessions';
'${HttpString.tUrl}/session_svr/v1/session_svr/get_sessions';

/// 私聊用户信息
/// uids
/// build=0&mobi_app=web
static const String sessionAccountList =
'https://api.vc.bilibili.com/account/v1/user/cards';
'${HttpString.tUrl}/account/v1/user/cards';

/// https://api.vc.bilibili.com/svr_sync/v1/svr_sync/fetch_session_msgs?
/// talker_id=400787461&
Expand All @@ -358,7 +360,7 @@ class Api {
/// wts=1697350697
static const String sessionMsg =
'https://api.vc.bilibili.com/svr_sync/v1/svr_sync/fetch_session_msgs';
'${HttpString.tUrl}/svr_sync/v1/svr_sync/fetch_session_msgs';

/// 标记已读 POST
/// talker_id:
Expand All @@ -369,7 +371,7 @@ class Api {
/// csrf_token:
/// csrf:
static const String updateAck =
'https://api.vc.bilibili.com/session_svr/v1/session_svr/update_ack';
'${HttpString.tUrl}/session_svr/v1/session_svr/update_ack';

// 获取某个动态详情
// timezone_offset=-480
Expand All @@ -388,19 +390,19 @@ class Api {

// captcha验证码
static const String getCaptcha =
'https://passport.bilibili.com/x/passport-login/captcha?source=main_web';
'${HttpString.passBaseUrl}/x/passport-login/captcha?source=main_web';

// web端短信验证码
static const String smsCode =
'https://passport.bilibili.com/x/passport-login/web/sms/send';
'${HttpString.passBaseUrl}/x/passport-login/web/sms/send';

// web端验证码登录

// web端密码登录

// app端短信验证码
static const String appSmsCode =
'https://passport.bilibili.com/x/passport-login/sms/send';
'${HttpString.passBaseUrl}/x/passport-login/sms/send';

// app端验证码登录

Expand All @@ -414,25 +416,24 @@ class Api {
/// key
/// rhash
static const String loginInByPwdApi =
'https://passport.bilibili.com/x/passport-login/oauth2/login';
'${HttpString.passBaseUrl}/x/passport-login/oauth2/login';

/// 密码加密密钥
/// disable_rcmd
/// local_id
static const getWebKey =
'https://passport.bilibili.com/x/passport-login/web/key';
static const getWebKey = '${HttpString.passBaseUrl}/x/passport-login/web/key';

/// cookie转access_key
static const cookieToKey =
'https://passport.bilibili.com/x/passport-tv-login/h5/qrcode/confirm';
'${HttpString.passBaseUrl}/x/passport-tv-login/h5/qrcode/confirm';

/// 申请二维码(TV端)
static const getTVCode =
'https://passport.snm0516.aisee.tv/x/passport-tv-login/qrcode/auth_code';

///扫码登录(TV端)
static const qrcodePoll =
'https://passport.bilibili.com/x/passport-tv-login/qrcode/poll';
'${HttpString.passBaseUrl}/x/passport-tv-login/qrcode/poll';

/// 置顶视频
static const getTopVideoApi = '/x/space/top/arc';
Expand Down
5 changes: 4 additions & 1 deletion lib/http/constants.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class HttpString {
static const String baseUrl = 'https://www.bilibili.com';
static const String baseApiUrl = 'https://api.bilibili.com';
static const String apiBaseUrl = 'https://api.bilibili.com';
static const String tUrl = 'https://api.vc.bilibili.com';
static const String appBaseUrl = 'https://app.bilibili.com';
static const String liveBaseUrl = 'https://api.live.bilibili.com';
static const String passBaseUrl = 'https://passport.bilibili.com';
static const List<int> validateStatusCodes = [
302,
304,
Expand Down
12 changes: 8 additions & 4 deletions lib/http/html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ class HtmlHttp {
//
String opusContent =
opusDetail.querySelector('.opus-module-content')!.innerHtml;
String test = opusDetail
.querySelector('.horizontal-scroll-album__pic__img')!
.innerHtml;
String? test;
try {
test = opusDetail
.querySelector('.horizontal-scroll-album__pic__img')!
.innerHtml;
} catch (_) {}

String commentId = opusDetail
.querySelector('.bili-comment-container')!
.className
Expand All @@ -54,7 +58,7 @@ class HtmlHttp {
'avatar': avatar,
'uname': uname,
'updateTime': updateTime,
'content': test + opusContent,
'content': (test ?? '') + opusContent,
'commentId': int.parse(commentId)
};
} catch (err) {
Expand Down
4 changes: 2 additions & 2 deletions lib/http/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Request {
// 从cookie中获取 csrf token
static Future<String> getCsrf() async {
var cookies = await cookieManager.cookieJar
.loadForRequest(Uri.parse(HttpString.baseApiUrl));
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
String token = '';
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
Expand All @@ -91,7 +91,7 @@ class Request {
//BaseOptions、Options、RequestOptions 都可以配置参数,优先级别依次递增,且可以根据优先级别覆盖参数
BaseOptions options = BaseOptions(
//请求基地址,可以包含子路径
baseUrl: HttpString.baseApiUrl,
baseUrl: HttpString.apiBaseUrl,
//连接服务器超时时间,单位是毫秒.
connectTimeout: const Duration(milliseconds: 12000),
//响应流上前后两次接受到数据的间隔,单位为毫秒。
Expand Down
30 changes: 18 additions & 12 deletions lib/http/video.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class VideoHttp {
static Future rcmdVideoList({required int ps, required int freshIdx}) async {
try {
var res = await Request().get(
Api.recommendList,
Api.recommendListWeb,
data: {
'version': 1,
'feed_version': 'V3',
Expand Down Expand Up @@ -122,27 +122,33 @@ class VideoHttp {
static Future videoUrl(
{int? avid, String? bvid, required int cid, int? qn}) async {
Map<String, dynamic> data = {
// 'avid': avid,
'bvid': bvid,
'cid': cid,
// 'qn': qn ?? 80,
'qn': qn ?? 80,
// 获取所有格式的视频
'fnval': 4048,
// 'fnver': '',
'fourk': 1,
// 'session': '',
// 'otype': '',
// 'type': '',
// 'platform': '',
// 'high_quality': ''
};
if (avid != null) {
data['avid'] = avid;
}
if (bvid != null) {
data['bvid'] = bvid;
}

Map params = await WbiSign().makSign({
...data,
'fourk': 1,
'voice_balance': 1,
'gaia_source': 'pre-load',
'web_location': 1550101,
});

// 免登录查看1080p
if (userInfoCache.get('userInfoCache') == null &&
setting.get(SettingBoxKey.p1080, defaultValue: true)) {
data['try_look'] = 1;
}
try {
var res = await Request().get(Api.videoUrl, data: data);
var res = await Request().get(Api.videoUrl, data: params);
if (res.data['code'] == 0) {
return {
'status': true,
Expand Down
7 changes: 7 additions & 0 deletions lib/models/common/rcmd_type.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// 首页推荐类型
enum RcmdType { web, app }

extension RcmdTypeExtension on RcmdType {
String get values => ['web', 'app'][index];
String get labels => ['web端', 'app端'][index];
}
Loading

0 comments on commit 10a547d

Please sign in to comment.