Skip to content

Commit

Permalink
weibo live
Browse files Browse the repository at this point in the history
  • Loading branch information
Shengming Yuan committed Mar 1, 2019
1 parent 99839e9 commit 3935d27
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/ssysm/StreamGetterV2.svg?branch=master)](https://travis-ci.org/ssysm/StreamGetterV2)

流媒体链接抓取工具 使用Electron&NodeJS(底层Runtime) + Angular6 (UI)框架,使用GPL-V3.0许可证发行。
流媒体链接抓取工具 使用Electron&NodeJS(底层Runtime) + Angular7 (UI)框架,使用GPL-V3.0许可证发行。

## 支持的流平台

Expand All @@ -11,6 +11,7 @@
- Niconico 生放送(如何实现?[点击这里](https://blog.theeditorstudio.com/index.php/blog/niconico%E7%94%9F%E6%94%BE%E6%BA%90%E6%8A%93%E6%B5%81%E8%AF%A6%E8%A7%A3))
- Hibiki Radio Station
- Onsen.ag 音泉
- Weibo.com 直播

## 使用展示

Expand Down
5 changes: 5 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { NiconicoComponent } from './components/platforms/niconico/niconico.comp
import { SessionComponent } from './components/session/session.component';
import { AboutComponent } from './components/about/about.component';
import { OnsenagComponent } from './components/platforms/onsenag/onsenag.component';
import { SinaLiveComponent } from './components/platforms/sina-live/sina-live.component';

const routes: Routes = [
{
Expand All @@ -34,6 +35,10 @@ const routes: Routes = [
path: 'onsenag',
component: OnsenagComponent
},
{
path: 'sina-live',
component: SinaLiveComponent
},
{
path: 'settings',
children: [
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { FfmpegCommandPipe } from './pipes/ffmpeg-command.pipe';
import { NiconicoComponent } from './components/platforms/niconico/niconico.component';
import { AboutComponent } from './components/about/about.component';
import { OnsenagComponent } from './components/platforms/onsenag/onsenag.component';
import { SinaLiveComponent } from './components/platforms/sina-live/sina-live.component';

// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
Expand All @@ -50,6 +51,7 @@ export function HttpLoaderFactory(http: HttpClient) {
NiconicoComponent,
AboutComponent,
OnsenagComponent,
SinaLiveComponent,
],
imports: [
BrowserModule,
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/about/about.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1 id="streamgetter">StreamGetter</h1>

<p><img src="https://travis-ci.org/ssysm/StreamGetterV2.svg?branch=master" alt="Build Status" />
流媒体链接抓取工具 使用Electron&amp;NodeJS(底层Runtime) + Angular6 (UI)框架,使用GPL-V3.0许可证发行。</p>
流媒体链接抓取工具 使用Electron&amp;NodeJS(底层Runtime) + Angular7 (UI)框架,使用GPL-V3.0许可证发行。</p>
<hr>
<h3 id="">支持的流平台</h3>

Expand All @@ -16,6 +16,8 @@ <h3 id="">支持的流平台</h3>
<li>Hibiki Radio Station</li>

<li>Onsen.ag 音泉</li>

<li>新浪微博直播</li>
</ul>
<hr>
<div class="update">
Expand Down
1 change: 1 addition & 0 deletions src/app/components/particals/navbar/navbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<li><a [routerLink]="['/hibiki']" routerLinkActive="active">HiBiKi Radio</a></li>
<li><a [routerLink]="['/onsenag']" routerLinkActive="active">音泉 onsen.ag</a></li>
<li><a [routerLink]="['/niconico']" routerLinkActive="active">Niconico 生放</a></li>
<li><a [routerLink]="['/sina-live']" routerLinkActive="active">新浪微博直播</a></li>

<li><div class="divider"></div></li>
<li><a class="subheader"><i class="material-icons">settings</i>设置</a></li>
Expand Down
47 changes: 47 additions & 0 deletions src/app/components/platforms/sina-live/sina-live.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<div class="container">
<h3>微博直播流获取</h3>
<div class="row">
<form class="col s12">
<div class="row">
<div class="col s12">
<p>请输入节目ID</p>
<span>
http://live.weibo.com/show?id=
</span>
<div class="input-field inline">
<input style="width:200px" id="showId_inline" name="showId" type="text" [(ngModel)]="showId">
</div>
<a class="btn" (click)="loadStreamList()">解流</a>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col s4">
<label for="uid">微博用户ID</label>
<input name="uid" type="text" [(ngModel)]="uid">
</div>
<div class="col s4">
<label for="expiresHours">保活时长(小时)</label>
<input name="expiresHours" disabled class="disbaled" type="number" min="1" max="4" [(ngModel)]="expiresHours">
</div>
</div>
<div class="row" id="table" *ngIf="showStreamListTable">
<table class="responsive-table highlight striped">
<thead>
<tr>
<th>类型</th>
<th>分辨率</th>
<th>链接</th>
</tr>
</thead>
<tbody *ngFor="let item of streamList">
<tr>
<td>视频</td>
<td>{{item.title}}</td>
<td>{{item.url}}</td>
</tr>
</tbody>
</table>
</div>
</div>
Empty file.
25 changes: 25 additions & 0 deletions src/app/components/platforms/sina-live/sina-live.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SinaLiveComponent } from './sina-live.component';

describe('SinaLiveComponent', () => {
let component: SinaLiveComponent;
let fixture: ComponentFixture<SinaLiveComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SinaLiveComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SinaLiveComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
57 changes: 57 additions & 0 deletions src/app/components/platforms/sina-live/sina-live.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { Component, OnInit } from '@angular/core';
import { SinaLiveService } from '../../../providers/platforms/sina-live.service';
import { ElectronService } from '../../../providers/electron.service';

@Component({
selector: 'app-sina-live',
templateUrl: './sina-live.component.html',
styleUrls: ['./sina-live.component.scss']
})
export class SinaLiveComponent implements OnInit {

constructor(
private sinaLiveService: SinaLiveService,
private electronService: ElectronService
) { }

showId = '';
uid = '6778227457';
expiresHours = 2;

streamList = [];
showStreamListTable = false;

ngOnInit() {
}

loadStreamList() {
this.showStreamListTable = false;
this.streamList = [];
let queryStr = this.sinaLiveService.buildQueryString(this.showId, this.uid);
let sign = this.sinaLiveService.getSign(queryStr);
let uri = this.sinaLiveService.buildStreamUri();

this.sinaLiveService.getStream(uri)
.subscribe(response => {
if (response['status'] === 0) {
this.electronService.remote.dialog.showMessageBox({
type: 'error',
message: '获取信息失败,请检查您的网络链接/流服务平台状态'
});
} else {
this.streamList = response['stream'];
this.streamList.push({
title: 'RTMP',
url: response['rtmp_url']
});
this.showStreamListTable = true;
}
}, err => {
this.electronService.remote.dialog.showMessageBox({
type: 'error',
message: '获取信息失败,请检查您的网络链接/流服务平台状态'
});
});
}

}
Loading

0 comments on commit 3935d27

Please sign in to comment.